dmitry          Tue Oct 11 02:48:34 2005 EDT

  Added files:                 (Branch: PHP_4_4)
    /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.1247.2.920.2.53&r2=1.1247.2.920.2.54&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1247.2.920.2.53 php-src/NEWS:1.1247.2.920.2.54
--- php-src/NEWS:1.1247.2.920.2.53      Mon Oct 10 06:47:52 2005
+++ php-src/NEWS        Tue Oct 11 02:48:31 2005
@@ -1,6 +1,8 @@
 PHP 4                                                                      NEWS
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 ?? Oct 2005, Version 4.4.1
+- Fixed bug #34790 (preg_match_all(), named capturing groups, variable
+  assignment/return => crash). (Dmitry)
 - Fixed bug #34704 (Infinite recursion due to corrupt JPEG). (Marcus)
 - Fixed bug #33383 (crash when retrieving empty LOBs). (Tony)
        
http://cvs.php.net/diff.php/php-src/ext/pcre/php_pcre.c?r1=1.132.2.24&r2=1.132.2.24.2.1&ty=u
Index: php-src/ext/pcre/php_pcre.c
diff -u php-src/ext/pcre/php_pcre.c:1.132.2.24 
php-src/ext/pcre/php_pcre.c:1.132.2.24.2.1
--- php-src/ext/pcre/php_pcre.c:1.132.2.24      Tue May 31 08:56:00 2005
+++ php-src/ext/pcre/php_pcre.c Tue Oct 11 02:48:33 2005
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: php_pcre.c,v 1.132.2.24 2005/05/31 12:56:00 sniper Exp $ */
+/* $Id: php_pcre.c,v 1.132.2.24.2.1 2005/10/11 06:48:33 dmitry Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -608,6 +608,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