php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #61359 [PATCH] json_encode() calls too many reallocs
Submitted: 2012-03-12 14:35 UTC Modified: 2012-07-01 02:15 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: gopalv@php.net Assigned: stas (profile)
Status: Closed Package: json (PECL)
PHP Version: 5.4SVN-2012-03-12 (SVN) OS: Linux x86_64 2.6.32-38-generic
Private report: No CVE-ID: None
 [2012-03-12 14:35 UTC] gopalv@php.net
Description:
------------
json_encode() produces many reallocations in the string escaping code

It is highly likely that escaping a string will produce a string at least as long as the original string - the current code reallocs every 128 bytes.


Patches

json.c.diff (last revision 2012-03-12 14:35 UTC by gopalv@php.net)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-03-12 14:35 UTC] gopalv@php.net
The following patch has been added/updated:

Patch Name: json.c.diff
Revision:   1331562942
URL:        https://bugs.php.net/patch-display.php?bug=61359&patch=json.c.diff&revision=1331562942
 [2012-03-12 14:37 UTC] pajoye@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: stas
 [2012-03-12 14:37 UTC] pajoye@php.net
Dos it look for 5.4? Tests pass.
 [2012-07-01 02:15 UTC] stas@php.net
Automatic comment on behalf of stas
Revision: http://git.php.net/?p=php-src.git;a=commit;h=b741d3315be5cbddae5a895b9dceb2b71d394366
Log: fix bug #61359: json_encode() calls too many reallocs
 [2012-07-01 02:15 UTC] stas@php.net
This bug has been fixed in SVN.

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/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.


 [2012-07-01 02:15 UTC] stas@php.net
-Status: Assigned +Status: Closed
 [2014-10-07 23:24 UTC] stas@php.net
Automatic comment on behalf of stas
Revision: http://git.php.net/?p=php-src-security.git;a=commit;h=b741d3315be5cbddae5a895b9dceb2b71d394366
Log: fix bug #61359: json_encode() calls too many reallocs
 [2014-10-07 23:35 UTC] stas@php.net
Automatic comment on behalf of stas
Revision: http://git.php.net/?p=php-src-security.git;a=commit;h=b741d3315be5cbddae5a895b9dceb2b71d394366
Log: fix bug #61359: json_encode() calls too many reallocs
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 03:01:29 2024 UTC