From 74a29468ef14260ea3c210a2d1e3548806c81339 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Wed, 5 Jul 2017 13:42:55 +0300 Subject: [PATCH] Disabled evaluation of strpos() with empty needle. --- ext/opcache/Optimizer/sccp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ext/opcache/Optimizer/sccp.c b/ext/opcache/Optimizer/sccp.c index 4fbd8adb5cf..7ee91ed0498 100644 --- a/ext/opcache/Optimizer/sccp.c +++ b/ext/opcache/Optimizer/sccp.c @@ -477,7 +477,10 @@ static inline int ct_eval_func_call( return SUCCESS; } else if (zend_string_equals_literal(name, "strpos")) { const char *found; - if (num_args != 2 || Z_TYPE_P(args[0]) != IS_STRING || Z_TYPE_P(args[1]) != IS_STRING) { + if (num_args != 2 + || Z_TYPE_P(args[0]) != IS_STRING + || Z_TYPE_P(args[1]) != IS_STRING + || !Z_STRLEN_P(args[1])) { return FAILURE; }