Req #71734 [Opn]: mbfl_string only support unsigned int for string length

From: Date: Tue, 08 Mar 2016 09:32:01 +0000
Subject: Req #71734 [Opn]: mbfl_string only support unsigned int for string length
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-199664@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=71734&edit=1

 ID:                 71734
 Updated by:         ab@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:

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.


Previous Comments:
------------------------------------------------------------------------
[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)

« previous php.bugs (#199664) next »