Skip to content

Commit c351b47

Browse files
committed
Initialize the offset table - PCRE may sometimes miss offsets
1 parent 1a2ec3f commit c351b47

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/pcre/php_pcre.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, char *subject, int subjec
640640
}
641641

642642
offsets = (int *)safe_emalloc(size_offsets, sizeof(int), 0);
643-
643+
memset(offsets, 0, size_offsets*sizeof(int));
644644
/* Allocate match sets array and initialize the values. */
645645
if (global && subpats && subpats_order == PREG_PATTERN_ORDER) {
646646
match_sets = (zval **)safe_emalloc(num_subpats, sizeof(zval *), 0);

0 commit comments

Comments
 (0)