summaryrefslogtreecommitdiff
path: root/ext/pcre/php_pcre.c
diff options
context:
space:
mode:
authorChristoph M. Becker <cmb@php.net>2016-07-27 18:50:52 +0200
committerChristoph M. Becker <cmb@php.net>2016-07-27 18:50:52 +0200
commit315c0536c20619478fc548b782132cd65286018f (patch)
treef2533d1014c1912532e5eb8451f8e031b00bd5af /ext/pcre/php_pcre.c
parentcc125f277b50e0f90fc8033fe7f47d2446389a15 (diff)
downloadphp-git-315c0536c20619478fc548b782132cd65286018f.tar.gz
Fix #72688: preg_match missing group names in matches
We have to multiply with 0x100 to properly scale the high byte.
Diffstat (limited to 'ext/pcre/php_pcre.c')
-rw-r--r--ext/pcre/php_pcre.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c
index 6b258b9a20..ddc5d764f9 100644
--- a/ext/pcre/php_pcre.c
+++ b/ext/pcre/php_pcre.c
@@ -215,7 +215,7 @@ static char **make_subpats_table(int num_subpats, pcre_cache_entry *pce TSRMLS_D
}
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 TSRMLS_CC, E_WARNING, "Numeric named subpatterns are not allowed");