Req #71734 [Opn]: mbfl_string only support unsigned int for string length
Edit report at https://bugs.php.net/bug.php?id=71734&edit=1
ID: 71734
Updated by: yohgaki@php.net
Reported by: yohgaki@php.net
Summary: mbfl_string only support unsigned int for string
length
Status: Open
Type: Feature/Change Request
Package: mbstring related
Operating System: irrelevant
PHP Version: Next Minor Version
Block user comment: N
Private report: N
New Comment:
s/support 2GB> strings/support 4GB> strings/
It's "unsigned int".
@anatol
I'll ping libmbfl developers if they can work on it. If not, I may.
Previous Comments:
------------------------------------------------------------------------
[2016-03-08 09:31:59] ab@php.net
Thanks for the checks, Yasuo. This was brought up by Nikita here https://github.com/php/php-src/pull/810 as the PR
was partially incompatible, so this issue was overseen.
For how to go with fixing this - IMHO I'd see an issue in just patching the bundled libmbfl.
Instead a proper PR should go into https://github.com/moriyoshi/libmbfl . There will be
for sure some incompatible places in libmbfl itself once size_t is used. But once it's in and
we bundle a new version, we could just revert the patch you've linked. Though, unfortunately it
seems that the libmbfl repo doesn't have much activity lately.
Thanks.
------------------------------------------------------------------------
[2016-03-08 02:07:54] yohgaki@php.net
Related commit
http://git.php.net/?p=php-src.git;a=commitdiff;h=89a43425072feda1fc5546aaaaa7be7737c4f197
------------------------------------------------------------------------
[2016-03-07 22:04:44] yohgaki@php.net
Description:
------------
mbstring's string is defined as follows
mbfl_string.h
/*
* string object
*/
typedef struct _mbfl_string {
enum mbfl_no_language no_language;
enum mbfl_no_encoding no_encoding;
unsigned char *val;
unsigned int len;
} mbfl_string;
"unsigned int len" should be extended to "size_t len" to support 2GB>
strings.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=71734&edit=1
Thread (5 messages)