php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #61059 array_fill leaks if start index is PHP_INT_MAX
Submitted: 2012-02-11 19:51 UTC Modified: 2012-02-11 20:12 UTC
From: nikic@php.net Assigned:
Status: Duplicate Package: *General Issues
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: nikic@php.net
New email:
PHP Version: OS:

 

 [2012-02-11 19:51 UTC] nikic@php.net
Description:
------------
<?php array_fill(PHP_INT_MAX, 2, '*')

Leaks:


[Sat Feb 11 20:47:35 2012]  Script:  'reproduceCode4_memoryLeak.php'
/home/nikic/dev/php-src-git/Zend/zend_vm_execute.h(2371) :  Freeing 0xB786F010 
(20 bytes), script=reproduceCode4_memoryLeak.php
[Sat Feb 11 20:47:35 2012]  Script:  'reproduceCode4_memoryLeak.php'
/home/nikic/dev/php-src-git/Zend/zend_vm_execute.h(2374) :  Freeing 0xB7870558 
(1 bytes), script=reproduceCode4_memoryLeak.php
/home/nikic/dev/php-src-git/Zend/zend_variables.c(121) : Actual location 
(location was relayed)
=== Total 2 memory leaks detected ===

Reason:

zval_add_ref is called regardless of whether zend_hash_next_index_insert 
succeeds in 
http://lxr.php.net/opengrok/xref/PHP_TRUNK/ext/standard/array.c#1570.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-02-11 20:12 UTC] johannes@php.net
-Status: Open +Status: Duplicate
 [2012-02-11 20:12 UTC] johannes@php.net
See #61058
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 01:01:30 2024 UTC