Disabled evaluation of strpos() with empty needle.

This commit is contained in:
Dmitry Stogov 2017-07-05 13:42:55 +03:00
parent e8908946e5
commit 74a29468ef

View File

@ -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;
}