Skip to content
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 decoding nil pointer into a previously used object #13

Merged
merged 2 commits into from
Oct 28, 2020

Conversation

bartekn
Copy link

@bartekn bartekn commented Oct 23, 2020

This commit fixes a bug in Decoder.decodePtr. When decoding a struct with a pointer field into previously used object (ex. in a loop with object created outside of the loop) the previous non-nil pointer value was not overwritten if the new value was nil. See TestDecodeNilPointerIntoExistingObjectWithNotNilPointer for more context.

@bartekn bartekn changed the title Fix decoding nil pointer to the previously used object Fix decoding nil pointer into a previously used object Oct 23, 2020
@bartekn bartekn requested review from leighmcculloch and a team October 23, 2020 15:37
@bartekn bartekn merged commit f80a23d into master Oct 28, 2020
@bartekn bartekn deleted the fix-nil-ptr-decod branch October 28, 2020 10:27
bartekn added a commit to stellar/go that referenced this pull request Oct 28, 2020
Upgrade `go-xdr` to the latest version. The new version fixes two bugs
in `Decoder`: stellar/go-xdr#13 stellar/go-xdr#14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants