I just open a new thread just for this bug.
If one of the RM could please confirm that I can commit the patch to
the PHP5.4 branch.

Thanks
Pierrick
Index: NEWS
===================================================================
--- NEWS        (revision 322482)
+++ NEWS        (working copy)
@@ -7,6 +7,7 @@
 - Core:
   . Restoring $_SERVER['REQUEST_TIME'] as a long and introducing
     $_SERVER['REQUEST_TIME_FLOAT'] to include microsecond precision. (Patrick)
+  . Fixed bug #60809 (Traits phpdoc double free) (Pierrick)
   . Fixed bug #60768 (Output buffer not discarded) (Mike)
 
 - Hash
Index: Zend/zend_compile.c
===================================================================
--- Zend/zend_compile.c (revision 322482)
+++ Zend/zend_compile.c (working copy)
@@ -4141,6 +4141,7 @@
        zend_bool parent_prop_is_private = 0;
        zend_bool not_compatible;
        zval* prop_value;
+       char *doc_comment;
   
   
        /* In the following steps the properties are inserted into the property 
table
@@ -4236,9 +4237,15 @@
                        }
                        Z_ADDREF_P(prop_value);
 
+                       if (property_info->doc_comment) {
+                               doc_comment = 
estrndup(property_info->doc_comment, property_info->doc_comment_len);
+                       } else {
+                               doc_comment = NULL;
+                       }
+
                        zend_declare_property_ex(ce, prop_name, 
prop_name_length, 
                                                                         
prop_value, property_info->flags, 
-                                                                    
property_info->doc_comment, property_info->doc_comment_len TSRMLS_CC);
+                                                                    
doc_comment, property_info->doc_comment_len TSRMLS_CC);
                }
        }
 }
Index: Zend/tests/bug60809.phpt
===================================================================
--- Zend/tests/bug60809.phpt    (revision 0)
+++ Zend/tests/bug60809.phpt    (revision 0)
@@ -0,0 +1,18 @@
+--TEST--
+Bug #60809 (traits - phpdoc double free)
+--FILE--
+<?php
+
+class Example {
+    use ExampleTrait;
+}
+
+trait ExampleTrait {
+    /**
+     *
+     */
+    public $hello_world = 'hello World ^^';
+}
+echo 'DONE';
+--EXPECT--
+DONE
-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to