apache/dubbo-go-hessian2

Repeat registration of pojo

binbin0325 opened this issue · 0 comments

What happened:
1.9.4 the key that registers the POJO updates the logic.key increase the package name.
struct name is still used when loading and checking registry POJOs.
this can lead to duplicate registrations and, in extreme cases, affect encode.

The scope of the current impact is that the dubbo-go-samples upgrade hessian 1.9.4 integration test failed

1.9.4 update:
`func getGoName(o interface{}) string {
goType := reflect.TypeOf(o)
for reflect.Ptr == goType.Kind() {
goType = goType.Elem()
}
return combineGoName(goType)
}

func combineGoName(t reflect.Type) string {
pkgPath := t.PkgPath()
goName := t.String()
if pkgPath == "" ||
(goPkgPathWhiteListRegexp.Match([]byte(pkgPath)) &&
!goPkgPathBlackListRegexp.Match([]byte(pkgPath))) {
return goName
}
return pkgPath + "/" + goName
}`

influence:
image
image