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

rpc: fix double reference in CallContext unmarshal #26701

Closed
wants to merge 6 commits into from

Conversation

JasonYuan869
Copy link
Contributor

@JasonYuan869 JasonYuan869 commented Feb 15, 2023

Closes #26700.

Removes the redundant & from the json.Unmarshal call in CallContext. This function already checks that result is either nil or a pointer type, so the extra reference operator is unnecessary. This actually causes a bug where nulls are not unmarshalled correctly into json.RawMessage (see original ticket for details).

Added a test case to check that nulls are properly unmarshalled.

Feedback and comments are welcome and appreciated!

@JasonYuan869 JasonYuan869 marked this pull request as ready for review February 16, 2023 01:58
@fjl
Copy link
Contributor

fjl commented Feb 17, 2023

Re-submitted in #26723 to add a commit.

@fjl fjl closed this Feb 17, 2023
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.

rpc.Client.CallContext incorrectly unmarshalling null results
2 participants