dmitry          Tue Oct 11 02:48:13 2005 EDT

  Added files:                 (Branch: PHP_5_0)
    /php-src/ext/pcre/tests     bug34790.phpt 

  Modified files:              
    /php-src    NEWS 
    /php-src/ext/pcre   php_pcre.c 
  Log:
  Fixed bug #34790 (preg_match_all(), named capturing groups, variable 
assignment/return => crash)
  
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1760.2.496&r2=1.1760.2.497&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1760.2.496 php-src/NEWS:1.1760.2.497
--- php-src/NEWS:1.1760.2.496   Mon Oct 10 08:59:05 2005
+++ php-src/NEWS        Tue Oct 11 02:48:10 2005
@@ -4,6 +4,8 @@
 - Renamed CachingRecursiveIterator to RecursiveCachingIterator. (Marcus)
 - Fixed bug #34810 (mysqli::init() and others use wrong $this pointer 
   without checks). (Tony)
+- Fixed bug #34790 (preg_match_all(), named capturing groups, variable
+  assignment/return => crash). (Dmitry)
 - Fixed bug #34788 (SOAP Client not applying correct namespace to generated
   values). (Dmitry)
 - Fixed bug #34787 (SOAP Client not handling boolean types correctly). (Dmitry)
http://cvs.php.net/diff.php/php-src/ext/pcre/php_pcre.c?r1=1.157.2.5&r2=1.157.2.6&ty=u
Index: php-src/ext/pcre/php_pcre.c
diff -u php-src/ext/pcre/php_pcre.c:1.157.2.5 
php-src/ext/pcre/php_pcre.c:1.157.2.6
--- php-src/ext/pcre/php_pcre.c:1.157.2.5       Tue May 31 08:55:33 2005
+++ php-src/ext/pcre/php_pcre.c Tue Oct 11 02:48:11 2005
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: php_pcre.c,v 1.157.2.5 2005/05/31 12:55:33 sniper Exp $ */
+/* $Id: php_pcre.c,v 1.157.2.6 2005/10/11 06:48:11 dmitry Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -620,6 +620,7 @@
                        if (subpat_names[i]) {
                                zend_hash_update(Z_ARRVAL_P(subpats), 
subpat_names[i],
                                                                 
strlen(subpat_names[i])+1, &match_sets[i], sizeof(zval *), NULL);
+                               ZVAL_ADDREF(match_sets[i]);
                        }
                        zend_hash_next_index_insert(Z_ARRVAL_P(subpats), 
&match_sets[i], sizeof(zval *), NULL);
                }

http://cvs.php.net/co.php/php-src/ext/pcre/tests/bug34790.phpt?r=1.1&p=1
Index: php-src/ext/pcre/tests/bug34790.phpt
+++ php-src/ext/pcre/tests/bug34790.phpt
--TEST--
Bug #34790 (preg_match_all(), named capturing groups, variable 
assignment/return => crash)
--FILE--
<?php
function func1(){
        $string = 'what the word and the other word the';
        preg_match_all('/(?P<word>the)/', $string, $matches);
        return $matches['word'];
}
$words = func1();
var_dump($words);
?>
--EXPECT--
array(4) {
  [0]=>
  string(3) "the"
  [1]=>
  string(3) "the"
  [2]=>
  string(3) "the"
  [3]=>
  string(3) "the"
}

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to