From: Christoph M. Becker Date: Wed, 27 Jul 2016 16:59:40 +0000 (+0200) Subject: Merge branch 'PHP-5.6' into PHP-7.0 X-Git-Tag: php-7.0.10RC1~35 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=40afd77826e19023df3f095525956f713bf0d96f;p=php Merge branch 'PHP-5.6' into PHP-7.0 # Resolved conflicts: # ext/pcre/php_pcre.c --- 40afd77826e19023df3f095525956f713bf0d96f diff --cc NEWS index 36f5f69d12,204defd4bb..322ff7835f --- a/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) diff --cc ext/pcre/php_pcre.c index 3d59b77005,ddc5d764f9..fe6b7b3984 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@@ -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; }