]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-5.6'
authorStanislav Malyshev <stas@php.net>
Mon, 3 Nov 2014 19:40:15 +0000 (11:40 -0800)
committerStanislav Malyshev <stas@php.net>
Mon, 3 Nov 2014 19:40:15 +0000 (11:40 -0800)
* PHP-5.6:
  Initialize the offset table - PCRE may sometimes miss offsets
  set default response code to 200
  set default response code to 200
  set default response code to 200
  fix NEWS & version
  NEWS
  Fix bug #68283: fileinfo: out-of-bounds read in elf note headers
  Fix bug #68113 (Heap corruption in exif_thumbnail())
  Fix bug #68089 - do not accept options with embedded \0
  Fixed bug #68044: Integer overflow in unserialize() (32-bits only)
  Fix bug #68027 - fix date parsing in XMLRPC lib

Conflicts:
ext/pcre/php_pcre.c

1  2 
ext/pcre/php_pcre.c

index 918214edb147684891f8dbb5c246a4746e2cde0a,55aa3de2e5e42abb2e243dd3913d6746b842a278..6f9f2aebbf4a6fd384c46ebc313d033ae189316b
@@@ -652,28 -636,24 +652,28 @@@ PHPAPI void php_pcre_match_impl(pcre_ca
        size_offsets = num_subpats * 3;
  
        /*
 -       * Build a mapping from subpattern numbers to their names. We will always
 -       * allocate the table, even though there may be no named subpatterns. This
 -       * avoids somewhat more complicated logic in the inner loops.
 +       * Build a mapping from subpattern numbers to their names. We will
 +       * allocate the table only if there are any named subpatterns.
         */
 -      subpat_names = make_subpats_table(num_subpats, pce TSRMLS_CC);
 -      if (!subpat_names) {
 -              RETURN_FALSE;
 +      subpat_names = NULL;
 +      if (pce->name_count > 0) {
 +              subpat_names = make_subpats_table(num_subpats, pce TSRMLS_CC);
 +              if (!subpat_names) {
 +                      RETURN_FALSE;
 +              }
        }
  
 -      offsets = (int *)safe_emalloc(size_offsets, sizeof(int), 0);
 +      if (size_offsets <= 32) {
 +              offsets = (int *)do_alloca(size_offsets * sizeof(int), use_heap);
 +      } else {
 +              offsets = (int *)safe_emalloc(size_offsets, sizeof(int), 0);
 +      }
+       memset(offsets, 0, size_offsets*sizeof(int));
        /* Allocate match sets array and initialize the values. */
        if (global && subpats && subpats_order == PREG_PATTERN_ORDER) {
 -              match_sets = (zval **)safe_emalloc(num_subpats, sizeof(zval *), 0);
 +              match_sets = (zval *)safe_emalloc(num_subpats, sizeof(zval), 0);
                for (i=0; i<num_subpats; i++) {
 -                      ALLOC_ZVAL(match_sets[i]);
 -                      array_init(match_sets[i]);
 -                      INIT_PZVAL(match_sets[i]);
 +                      array_init(&match_sets[i]);
                }
        }