@@ -1024,7 +1024,13 @@ static inline union _zend_function *zend_get_user_call_function(zend_class_entry
1024
1024
call_user_call -> num_args = 0 ;
1025
1025
call_user_call -> scope = ce ;
1026
1026
call_user_call -> fn_flags = ZEND_ACC_CALL_VIA_HANDLER ;
1027
- call_user_call -> function_name = STR_COPY (method_name );
1027
+ //??? keep compatibility for "\0" characters
1028
+ //??? see: Zend/tests/bug46238.phpt
1029
+ if (UNEXPECTED (strlen (method_name -> val ) != method_name -> len )) {
1030
+ call_user_call -> function_name = STR_INIT (method_name -> val , strlen (method_name -> val ), 0 );
1031
+ } else {
1032
+ call_user_call -> function_name = STR_COPY (method_name );
1033
+ }
1028
1034
1029
1035
return (union _zend_function * )call_user_call ;
1030
1036
}
@@ -1157,7 +1163,13 @@ static inline union _zend_function *zend_get_user_callstatic_function(zend_class
1157
1163
callstatic_user_call -> num_args = 0 ;
1158
1164
callstatic_user_call -> scope = ce ;
1159
1165
callstatic_user_call -> fn_flags = ZEND_ACC_STATIC | ZEND_ACC_PUBLIC | ZEND_ACC_CALL_VIA_HANDLER ;
1160
- callstatic_user_call -> function_name = STR_COPY (method_name );
1166
+ //??? keep compatibility for "\0" characters
1167
+ //??? see: Zend/tests/bug46238.phpt
1168
+ if (UNEXPECTED (strlen (method_name -> val ) != method_name -> len )) {
1169
+ callstatic_user_call -> function_name = STR_INIT (method_name -> val , strlen (method_name -> val ), 0 );
1170
+ } else {
1171
+ callstatic_user_call -> function_name = STR_COPY (method_name );
1172
+ }
1161
1173
1162
1174
return (zend_function * )callstatic_user_call ;
1163
1175
}
0 commit comments