dmitry          Tue Oct 11 02:47:48 2005 EDT

  Added files:                 (Branch: PHP_5_1)
    /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.2027.2.114&r2=1.2027.2.115&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.114 php-src/NEWS:1.2027.2.115
--- php-src/NEWS:1.2027.2.114   Mon Oct 10 16:02:58 2005
+++ php-src/NEWS        Tue Oct 11 02:47:47 2005
@@ -52,6 +52,8 @@
 - Fixed bug #34802 (Fixed crash on object instantiation failure). (Ilia)
 - Fixed bug #34796 (missing SSL linking in ext/ftp when configured as shared).
   (Jani)
+- 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.168.2.1&r2=1.168.2.2&ty=u
Index: php-src/ext/pcre/php_pcre.c
diff -u php-src/ext/pcre/php_pcre.c:1.168.2.1 
php-src/ext/pcre/php_pcre.c:1.168.2.2
--- php-src/ext/pcre/php_pcre.c:1.168.2.1       Thu Aug 18 09:34:39 2005
+++ php-src/ext/pcre/php_pcre.c Tue Oct 11 02:47:48 2005
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: php_pcre.c,v 1.168.2.1 2005/08/18 13:34:39 sniper Exp $ */
+/* $Id: php_pcre.c,v 1.168.2.2 2005/10/11 06:47:48 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