]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-5.6' into PHP-7.0
authorChristoph M. Becker <cmb@php.net>
Wed, 27 Jul 2016 16:59:40 +0000 (18:59 +0200)
committerChristoph M. Becker <cmb@php.net>
Wed, 27 Jul 2016 17:00:38 +0000 (19:00 +0200)
# Resolved conflicts:
# ext/pcre/php_pcre.c

1  2 
NEWS
ext/pcre/php_pcre.c

diff --cc NEWS
index 36f5f69d12e3ee6c7b68edabe83e50c363c5b7de,204defd4bb574395daea62c095396bfb2fd06f54..322ff7835fac0b81edba2de1164f8e6b3bace476
--- 1/NEWS
--- 2/NEWS
+++ b/NEWS
@@@ -51,15 -40,11 +51,18 @@@ PH
    . Fixed bug #68712 (suspicious if-else statements). (cmb)
  
  - Intl:
 +  . Fixed bug #72639 (Segfault when instantiating class that extends
 +    IntlCalendar and adds a property). (Laruence)
    . Partially fixed #72506 (idn_to_ascii for UTS #46 incorrect for long domain
      names). (cmb)
 -- PCRE:
 +
 +- Opcache:
 +  . Fixed bug #72590 (Opcache restart with kill_all_lockers does not work).
 +    (Keyur)
 +
++-PCRE:
+   . Fixed bug #72688 (preg_match missing group names in matches). (cmb)
  - PDO_pgsql:
    . Fixed bug #70313 (PDO statement fails to throw exception). (Matteo)
  
index 3d59b77005d8569d07a01f798a93b1c0012c4e23,ddc5d764f93a18f90f36442b356cda8df110f3d1..fe6b7b39846bec5339cd8e1eeec979e832324c98
@@@ -248,23 -194,22 +248,23 @@@ static char **make_subpats_table(int nu
        int rc;
        char *name_table;
        unsigned short name_idx;
 -      char **subpat_names = (char **)ecalloc(num_subpats, sizeof(char *));
 +      char **subpat_names;
 +      int rc1, rc2;
  
 -      rc = pcre_fullinfo(pce->re, extra, PCRE_INFO_NAMECOUNT, &name_cnt);
 +      rc1 = pcre_fullinfo(pce->re, extra, PCRE_INFO_NAMETABLE, &name_table);
 +      rc2 = pcre_fullinfo(pce->re, extra, PCRE_INFO_NAMEENTRYSIZE, &name_size);
 +      rc = rc2 ? rc2 : rc1;
        if (rc < 0) {
 -              php_error_docref(NULL TSRMLS_CC, E_WARNING, "Internal pcre_fullinfo() error %d", rc);
 -              efree(subpat_names);
 +              php_error_docref(NULL, E_WARNING, "Internal pcre_fullinfo() error %d", rc);
                return NULL;
        }
 -      if (name_cnt > 0) {
 -              int rc1, rc2;
  
 -              rc1 = pcre_fullinfo(pce->re, extra, PCRE_INFO_NAMETABLE, &name_table);
 -              rc2 = pcre_fullinfo(pce->re, extra, PCRE_INFO_NAMEENTRYSIZE, &name_size);
 -              rc = rc2 ? rc2 : rc1;
 -              if (rc < 0) {
 -                      php_error_docref(NULL TSRMLS_CC, E_WARNING, "Internal pcre_fullinfo() error %d", rc);
 +      subpat_names = (char **)ecalloc(num_subpats, sizeof(char *));
 +      while (ni++ < name_cnt) {
-               name_idx = 0xff * (unsigned char)name_table[0] + (unsigned char)name_table[1];
++              name_idx = 0x100 * (unsigned char)name_table[0] + (unsigned char)name_table[1];
 +              subpat_names[name_idx] = name_table + 2;
 +              if (is_numeric_string(subpat_names[name_idx], strlen(subpat_names[name_idx]), NULL, NULL, 0) > 0) {
 +                      php_error_docref(NULL, E_WARNING, "Numeric named subpatterns are not allowed");
                        efree(subpat_names);
                        return NULL;
                }