Skip to content

Commit 74a2946

Browse files
committed
Disabled evaluation of strpos() with empty needle.
1 parent e890894 commit 74a2946

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ext/opcache/Optimizer/sccp.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,10 @@ static inline int ct_eval_func_call(
477477
return SUCCESS;
478478
} else if (zend_string_equals_literal(name, "strpos")) {
479479
const char *found;
480-
if (num_args != 2 || Z_TYPE_P(args[0]) != IS_STRING || Z_TYPE_P(args[1]) != IS_STRING) {
480+
if (num_args != 2
481+
|| Z_TYPE_P(args[0]) != IS_STRING
482+
|| Z_TYPE_P(args[1]) != IS_STRING
483+
|| !Z_STRLEN_P(args[1])) {
481484
return FAILURE;
482485
}
483486

0 commit comments

Comments
 (0)