AlexStocks commented on code in PR #3284:
URL: https://github.com/apache/dubbo-go/pull/3284#discussion_r3039282623
##########
proxy/proxy_factory/default.go:
##########
@@ -130,7 +130,24 @@ func (pi *ProxyInvoker) Invoke(ctx context.Context,
invocation base.Invocation)
}
// prepare argv
- if (len(method.ArgsType()) == 1 || len(method.ArgsType()) == 2 &&
method.ReplyType() == nil) && method.ArgsType()[0].String() == "[]interface {}"
{
+ // NOTE: variadic check must come before the []interface{} passthrough
check below,
+ // because a variadic method like func(args ...interface{}) also has
argsType[0] == []interface{},
Review Comment:
[P0] 阻断级问题:虽然注释说明了变长参数检查必须在 []interface{}
检查之前,但这里仍可能存在类型判断不准确的问题。method.IsVariadic() 和 len(args) ==
len(method.ArgsType()) 的条件组合可能无法完全区分真正的 []interface{} 参数和变长参数的 []T
类型。建议加强类型验证逻辑以避免错误封装。
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]