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

From: Date: Sat, 22 Jul 2017 16:02:19 +0000
Subject: Req #71734 [Opn->Csd]: mbfl_string only support unsigned int for string length
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-210197@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:         nikic@php.net
 Reported by:        yohgaki@php.net
 Summary:            mbfl_string only support unsigned int for string
                     length
-Status:             Open
+Status:             Closed
 Type:               Feature/Change Request
 Package:            mbstring related
 Operating System:   irrelevant
 PHP Version:        Next Minor Version
-Assigned To:        
+Assigned To:        nikic
 Block user comment: N
 Private report:     N

 New Comment:

I've switched mbfl_string to use size_t in master.


Previous Comments:
------------------------------------------------------------------------
[2016-03-08 11:36:52] yohgaki@php.net

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.

------------------------------------------------------------------------
[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)

« previous php.bugs (#210197) next »