@@ -3318,7 +3318,7 @@ static void instantiate_reflection_method(INTERNAL_FUNCTION_PARAMETERS, bool is_
33183318 zend_object * orig_obj = NULL ;
33193319 zend_class_entry * ce = NULL ;
33203320 zend_string * class_name = NULL ;
3321- char * method_name ;
3321+ const char * method_name ;
33223322 size_t method_name_len ;
33233323 char * lcname ;
33243324
@@ -3361,11 +3361,11 @@ static void instantiate_reflection_method(INTERNAL_FUNCTION_PARAMETERS, bool is_
33613361 method_name = ZSTR_VAL (arg2_str );
33623362 method_name_len = ZSTR_LEN (arg2_str );
33633363 } else {
3364- char * tmp ;
3364+ const char * tmp ;
33653365 size_t tmp_len ;
3366- char * name = ZSTR_VAL (arg1_str );
3366+ const char * name = ZSTR_VAL (arg1_str );
33673367
3368- if ((tmp = strstr (name , "::" )) == NULL ) {
3368+ if ((tmp = zend_memnstr (name , "::" , 2 , name + ZSTR_LEN ( arg1_str ) )) == NULL ) {
33693369 zend_argument_error (reflection_exception_ptr , 1 , "must be a valid method name" );
33703370 RETURN_THROWS ();
33713371 }
@@ -4684,7 +4684,7 @@ ZEND_METHOD(ReflectionClass, getProperty)
46844684 zend_class_entry * ce , * ce2 ;
46854685 zend_property_info * property_info ;
46864686 zend_string * name , * classname ;
4687- char * tmp , * str_name ;
4687+ const char * tmp , * str_name ;
46884688 size_t classname_len , str_name_len ;
46894689
46904690 if (zend_parse_parameters (ZEND_NUM_ARGS (), "S" , & name ) == FAILURE ) {
@@ -4706,7 +4706,7 @@ ZEND_METHOD(ReflectionClass, getProperty)
47064706 }
47074707 }
47084708 str_name = ZSTR_VAL (name );
4709- if ((tmp = strstr (ZSTR_VAL (name ), "::" )) != NULL ) {
4709+ if ((tmp = zend_memnstr (ZSTR_VAL (name ), "::" , 2 , ZSTR_VAL ( name ) + ZSTR_LEN ( name ) )) != NULL ) {
47104710 classname_len = tmp - ZSTR_VAL (name );
47114711 classname = zend_string_init (ZSTR_VAL (name ), classname_len , 0 );
47124712 str_name_len = ZSTR_LEN (name ) - (classname_len + 2 );
0 commit comments