]> granicus.if.org Git - php/commitdiff
Initialize the offset table - PCRE may sometimes miss offsets
authorStanislav Malyshev <stas@php.net>
Mon, 3 Nov 2014 00:04:00 +0000 (16:04 -0800)
committerStanislav Malyshev <stas@php.net>
Mon, 3 Nov 2014 19:31:02 +0000 (11:31 -0800)
ext/pcre/php_pcre.c

index bd93f723d626c4a784bf52d794a96f6701adabf1..d7a4309b24d15977dae6c61c16950b882471644c 100644 (file)
@@ -640,7 +640,7 @@ PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, char *subject, int subjec
        }
 
        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);