We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dd68b4d commit 50677b6Copy full SHA for 50677b6
ext/mbstring/libmbfl/mbfl/mbfilter.c
@@ -881,6 +881,7 @@ mbfl_strpos(
881
goto out;
882
}
883
884
+ /* Bug somewhere in this segment for Out Of Bound detection (normal mode i.e. !reverse with negative offsets) */
885
if (!reverse) {
886
size_t jtbl[1 << (sizeof(unsigned char) * 8)];
887
size_t needle_u8_len = needle_u8->len;
@@ -897,6 +898,7 @@ mbfl_strpos(
897
898
e = haystack_u8_val + haystack_u8->len;
899
p = haystack_u8_val;
900
while (offset-- > 0) {
901
+ /* If positive offset is larger than the number of code points in the string */
902
if (p >= e) {
903
result = (size_t) -16;
904
0 commit comments