php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #62017 datefmt_create with incorrectly encoded timezone leaks pattern
Submitted: 2012-05-13 21:41 UTC Modified: 2012-05-23 13:53 UTC
From: [email protected] Assigned: cataphract (profile)
Status: Closed Package: intl (PECL)
PHP Version: master-Git-2012-05-13 (Git) OS:
Private report: No CVE-ID: None
 [2012-05-13 21:41 UTC] [email protected]
Description:
------------
The script

<?php
datefmt_create('', IntlDateFormatter::NONE, IntlDateFormatter::NONE, "\xff", IntlDateFormatter::GREGORIAN, 'a');

Produces this output:

[Sun May 13 23:39:54 2012]  Script:  '/home/nikic/dev/Phuzzy/results/workingFile1_memleak.php'
/home/nikic/dev/php-src/ext/intl/intl_convert.c(78) :  Freeing 0xB69401E4 (4 bytes), script=/home/nikic/dev/Phuzzy/results/workingFile1_memleak.php
/home/nikic/dev/php-src/Zend/zend_alloc.c(2529) : Actual location (location was relayed)
=== Total 1 memory leaks detected ===

The reason is that if an error occurs in http://lxr.php.net/opengrok/xref/PHP_TRUNK/ext/intl/dateformat/dateformat.c#109, then svalue isn't freed.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-05-23 13:53 UTC] [email protected]
-Status: Open +Status: Closed -Assigned To: +Assigned To: cataphract
 [2012-05-23 13:53 UTC] [email protected]
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.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Dec 31 03:00:01 2025 UTC