From: Stanislav Malyshev Date: Mon, 3 Nov 2014 00:04:00 +0000 (-0800) Subject: Initialize the offset table - PCRE may sometimes miss offsets X-Git-Tag: php-5.4.35~6 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c351b47ce85a3a147cfa801fa9f0149ab4160834;p=php Initialize the offset table - PCRE may sometimes miss offsets --- diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index bd93f723d6..d7a4309b24 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -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);