#43841 [NoF->Csd]: mb_strrpos offset is byte count for negative values
ID: 43841
Updated by: moriyoshi@php.net
Reported By: jmessa@php.net
-Status: No Feedback
+Status: Closed
Bug Type: mbstring related
Operating System: Windows XP
PHP Version: 5.2CVS-2008-01-14 (snap)
Assigned To: hirokawa
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2008-12-05 13:44:50] ant@php.net
I re-tested on the latest 5.2 snap and it looks like the output still
differs from the expected, I now get the following:
-- Offset is -25 --
Multibyte String:
Notice: mb_strrpos(): Offset is greater than the length of haystack
string in D:\Testing\test.php on line 11
bool(false)
ASCII String:
mb_strrpos:
Notice: mb_strrpos(): Offset is greater than the length of haystack
string in D:\Testing\test.php on line 14
bool(false)
strrpos:
Notice: strrpos(): Offset is greater than the length of haystack string
in D:\Testing\test.php on line 16
bool(false)
-- Offset is -24 --
Multibyte String:
Notice: mb_strrpos(): Offset is greater than the length of haystack
string in D:\Testing\test.php on line 11
bool(false)
ASCII String:
mb_strrpos:
Notice: mb_strrpos(): Offset is greater than the length of haystack
string in D:\Testing\test.php on line 14
bool(false)
strrpos:
Notice: strrpos(): Offset is greater than the length of haystack string
in D:\Testing\test.php on line 16
bool(false)
-- Offset is -13 --
Multibyte String: int(9)
ASCII String:
mb_strrpos: bool(false)
strrpos: bool(false)
-- Offset is -12 --
Multibyte String: int(9)
ASCII String:
mb_strrpos: int(9)
strrpos: int(9)
------------------------------------------------------------------------
[2008-02-26 01:00:00] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
------------------------------------------------------------------------
[2008-02-18 14:07:22] jmessa@php.net
I've run this test against the latest 5.2 and 5.3 snapshots and can see
that there's now bounds checking for this function and I'm getting
error messages returned as with strrpos (thanks!). When $offset = -13
the multibyte string is still returning int(9) though so it looks like
there is still a bug here.
Thanks for what you've done so far
------------------------------------------------------------------------
[2008-02-16 10:44:19] hirokawa@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5.3-latest.tar.gz
For Windows (zip):
http://snaps.php.net/win32/php5.3-win32-latest.zip
For Windows (installer):
http://snaps.php.net/win32/php5.3-win32-installer-latest.msi
------------------------------------------------------------------------
[2008-02-12 09:53:06] jmessa@php.net
I also thought I'd say now that I've committed a load of mbstring tests
to CVS if you haven't seen them already. Let me know if you'd like
anything changing in them.
Thanks!
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/43841
--
Edit this bug report at http://bugs.php.net/?id=43841&edit=1
Thread (9 messages)