From c00121c5a8397c9ce758288434fbf8622e864069 Mon Sep 17 00:00:00 2001 From: Rui Hirokawa Date: Sat, 16 Feb 2008 08:58:00 +0000 Subject: [PATCH] fixed bug #43840 mb_strpos bounds check is byte count rather than a character count. --- ext/mbstring/mbstring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c index f630cb884a..9932d73c87 100644 --- a/ext/mbstring/mbstring.c +++ b/ext/mbstring/mbstring.c @@ -1613,7 +1613,7 @@ PHP_FUNCTION(mb_strpos) } } - if (offset < 0 || (unsigned long)offset > haystack.len) { + if (offset < 0 || (unsigned long)offset > (unsigned long)mbfl_strlen(&haystack)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset not contained in string."); RETURN_FALSE; } -- 2.40.0