Skip to content

Commit b178992

Browse files
committed
Temporary fix for Zend/tests/bug46238.phpt
1 parent c6af378 commit b178992

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

Zend/zend_object_handlers.c

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,7 +1024,13 @@ static inline union _zend_function *zend_get_user_call_function(zend_class_entry
10241024
call_user_call->num_args = 0;
10251025
call_user_call->scope = ce;
10261026
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+
}
10281034

10291035
return (union _zend_function *)call_user_call;
10301036
}
@@ -1157,7 +1163,13 @@ static inline union _zend_function *zend_get_user_callstatic_function(zend_class
11571163
callstatic_user_call->num_args = 0;
11581164
callstatic_user_call->scope = ce;
11591165
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+
}
11611173

11621174
return (zend_function *)callstatic_user_call;
11631175
}

0 commit comments

Comments
 (0)