From: Anatol Belski Date: Tue, 19 Dec 2017 11:14:50 +0000 (+0100) Subject: Avoid strlen call X-Git-Tag: php-7.3.0alpha1~767 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=80571d6f967c879a5f1c457fbc51092df5d131a4;p=php Avoid strlen call --- diff --git a/ext/opcache/zend_accelerator_blacklist.c b/ext/opcache/zend_accelerator_blacklist.c index 78df0e476d..46d50cf96d 100644 --- a/ext/opcache/zend_accelerator_blacklist.c +++ b/ext/opcache/zend_accelerator_blacklist.c @@ -170,7 +170,6 @@ static void zend_accel_blacklist_update_regexp(zend_blacklist *blacklist) i++; } *p++ = ')'; - *p++ = '\0'; it = (zend_regexp_list*)malloc(sizeof(zend_regexp_list)); if (!it) { @@ -179,7 +178,7 @@ static void zend_accel_blacklist_update_regexp(zend_blacklist *blacklist) } it->next = NULL; - if ((it->re = pcre2_compile((PCRE2_SPTR)regexp, PCRE2_ZERO_TERMINATED, PCRE2_NO_AUTO_CAPTURE, &errnumber, &pcre_error_offset, cctx)) == NULL) { + if ((it->re = pcre2_compile((PCRE2_SPTR)regexp, p - regexp, PCRE2_NO_AUTO_CAPTURE, &errnumber, &pcre_error_offset, cctx)) == NULL) { free(it); pcre2_get_error_message(errnumber, pcre_error, sizeof(pcre_error)); blacklist_report_regexp_error((char *)pcre_error, pcre_error_offset);