1
0
mirror of https://github.com/php/php-src.git synced 2026-04-05 23:23:03 +02:00
Files
archived-php-src/ext/mbstring
Anatol Belski 4091e94660 Fixed bug #64769 mbstring PHPTs crash on Windows x64
The tricky business going there in oniguruma is saving a pointer
in an int variable, passing that variable into a function and making
it a pointer again. On 64bit windows casting a pointer to a 32 bit
int will truncate that pointer. This kind of things won't work on
Windows x64.

[SNIPPET]
unsigned long ul0[2], ul1, *ul2;

ul0[0] = 42uL;
ul0[0] = 24uL;

ul1 = (unsigned long)ul0;
ul2 = (unsigned long *)ul1;

/* now it's broken, accessing ul2[0] will crash. */
[/SNIPPET]

To make it portable, ULONG_PTR should be used in this case.

In oniguruma this behaviour is to see at least in the following
codepath:

ext/mbstring/oniguruma/enc/unicode.c:10938
ext/mbstring/oniguruma/st.c:308
ext/mbstring/oniguruma/enc/unicode.c:10859
2013-05-08 19:22:37 +02:00
..
2012-10-09 13:30:22 +08:00
2013-02-16 22:28:28 +08:00
2013-01-01 16:37:09 +08:00
2010-12-19 16:36:37 +00:00
2013-01-01 16:37:09 +08:00
2013-01-01 16:37:09 +08:00
2013-01-01 16:37:09 +08:00
2013-01-01 16:37:09 +08:00
2013-01-01 16:37:09 +08:00

!!Caution: DO NOT ADD/CHANGE MBSTRING CODE!!

New mbstring is under development, anyone who would like
add new feature/change behavior should access to development
source.

http://cvs.sourceforge.jp/cgi-bin/viewcvs.cgi/php-i18n/

All changes made after 2002/5/19 are subject to be
removed.

You are warned in php-dev and php-cvs lists many times
already. If you are curious, search archive for details.

Thank you.