New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix proto buffer pass by value, shallow copying or unsafe comparisons #1738
Labels
Comments
This was referenced Jun 27, 2019
This was referenced Jul 2, 2019
Merged
Merged
Martin2112
added a commit
to Martin2112/keytransparency
that referenced
this issue
Jul 3, 2019
Towards github.com/google/trillian#1738.
Martin2112
added a commit
to google/keytransparency
that referenced
this issue
Jul 3, 2019
* Fix proto copying in revisions and paginator tests. Towards github.com/google/trillian#1738. * Fix that nil / empty protos don't compare the same.
Can't 100% guarantee that I've fixed all of them but I think I've got most of the ones in our repositories that can be found by |
2 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We need to update proto buffer usages where they are passed by value or compared by generic code like
reflect.DeepEquals()
. Passing them by value creates shallow copies that can share internal state. As the generated structs contain additional exportedXXX_
fields managed by the proto implementation generic comparisons using all fields can produce incorrect results.Typical problem cases:
*proto1= proto2
json.Marshal
,reflect.DeepEquals
or similar on protosThe scope of this should be limited as we don't use protos heavily outside gRPC interfaces and storage.
The text was updated successfully, but these errors were encountered: