Please MFH the fix into the 5.2 branch.

On 16-Feb-08, at 3:58 AM, Rui Hirokawa wrote:

hirokawa                Sat Feb 16 08:58:01 2008 UTC

 Modified files:              (Branch: PHP_5_3)
   /php-src/ext/mbstring        mbstring.c
 Log:
fixed bug #43840 mb_strpos bounds check is byte count rather than a character count.

http://cvs.php.net/viewvc.cgi/php-src/ext/mbstring/mbstring.c?r1=1.224.2.22.2.25.2.5&r2=1.224.2.22.2.25.2.6&diff_format=u
Index: php-src/ext/mbstring/mbstring.c
diff -u php-src/ext/mbstring/mbstring.c:1.224.2.22.2.25.2.5 php-src/ ext/mbstring/mbstring.c:1.224.2.22.2.25.2.6 --- php-src/ext/mbstring/mbstring.c:1.224.2.22.2.25.2.5 Sat Feb 16 08:21:39 2008
+++ php-src/ext/mbstring/mbstring.c     Sat Feb 16 08:58:00 2008
@@ -17,7 +17,7 @@
+ ----------------------------------------------------------------------+
 */

-/* $Id: mbstring.c,v 1.224.2.22.2.25.2.5 2008/02/16 08:21:39 hirokawa Exp $ */ +/* $Id: mbstring.c,v 1.224.2.22.2.25.2.6 2008/02/16 08:58:00 hirokawa Exp $ */

/*
 * PHP 4 Multibyte String module "mbstring"
@@ -1613,7 +1613,7 @@
                }
        }

-       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;
        }

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Ilia Alshanetsky

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to