php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24772 Applying isset() to a dereferenced string causes leak
Submitted: 2003-07-23 13:28 UTC Modified: 2003-07-23 13:36 UTC
From: moriyoshi@php.net Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 4CVS-2003-07-23 (stable) OS: irrelevant
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: moriyoshi@php.net
New email:
PHP Version: OS:

 

 [2003-07-23 13:28 UTC] moriyoshi@php.net
Description:
------------
Applying isset() to a dereference element of the string causes a very small leak.

Reproduce code:
---------------
<?php
$a = "string";
var_dump(isset($a{0}));
?>


Expected result:
----------------
bool(true)

Actual result:
--------------
/home/koizumi/src/php-src-4/Zend/zend_execute.c(2399) : Freeing 0x0837545C (2 bytes), script=/tmp/test.php

 2397:     zval *str = T->EA.data.str_offset.str;
 2398:     char c = str->value.str.val[T->EA.data.str_offset.offset];
 2399:     T->tmp_var.value.str.val = estrndup(&c, 1);
 2400:     T->tmp_var.value.str.len = 1;
 2401:     isset = 1;
 2402: }


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-07-23 13:34 UTC] moriyoshi@php.net
Oops, I was using the wrong binary..
 [2003-07-23 13:35 UTC] iliaa@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, 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/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.

This was fixed on Monday, latest CVS sources do not have this problem.
 [2003-07-23 13:36 UTC] moriyoshi@php.net
must.. have.. sleep...
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Jul 14 17:01:34 2025 UTC