Closed sergeyklay closed 4 years ago
Possible fix:
diff --git a/ext/aop.c b/ext/aop.c
index 0bbb40003..df38204d4 100644
--- a/ext/aop.c
+++ b/ext/aop.c
@@ -149,6 +149,10 @@ static int pointcut_match_zend_class_entry(phalcon_aop_pointcut *pc, zend_class_
{
int i, matches;
+ if (pc == NULL || pc->re_class == NULL) {
+ return 0;
+ }
+
#if PHP_VERSION_ID >= 70300
pcre2_match_data *match_data = php_pcre_create_match_data(0, pc->re_class);
if (NULL == match_data) {
@@ -222,7 +226,7 @@ static int pointcut_match_zend_class_entry(phalcon_aop_pointcut *pc, zend_class_
#endif
ce = ce->parent;
}
-
+
#if PHP_VERSION_ID >= 70300
php_pcre_free_match_data(match_data);
#endif
@@ -285,7 +289,7 @@ static int pointcut_match_zend_function(phalcon_aop_pointcut *pc, zend_execute_d
if (pc->method_jok) {
int matches;
#if PHP_VERSION_ID >= 70300
- pcre2_match_data *match_data = php_pcre_create_match_data(0, pc->re_class);
+ pcre2_match_data *match_data = php_pcre_create_match_data(0, pc->re_method);
if (NULL == match_data) {
return 0;
}
Git commit: 40c0c21b73c15dccf947a015a2dd0c3a5ee9a432