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/client : pointer addr fix #26727

Closed
wants to merge 1 commit into from
Closed

rpc/client : pointer addr fix #26727

wants to merge 1 commit into from

Conversation

ucwong
Copy link
Contributor

@ucwong ucwong commented Feb 19, 2023

No description provided.

@ucwong ucwong requested review from fjl and holiman as code owners February 19, 2023 19:30
@@ -348,7 +348,7 @@ func (c *Client) CallContext(ctx context.Context, result interface{}, method str
if result == nil {
return nil
}
return json.Unmarshal(resp.Result, result)
return json.Unmarshal(resp.Result, &result)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It says on line 318:

// The result must be a pointer so that package json can unmarshal into it. You
// can also pass nil, in which case the result is ignored.

So this fix looks incorrect to me... (?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It says on line 318:

// The result must be a pointer so that package json can unmarshal into it. You
// can also pass nil, in which case the result is ignored.

So this fix looks incorrect to me... (?)

image

It is built correct in my side, did you on this 6d0c35e PR

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant this

Screenshot 2023-02-20 at 19-08-30 rpc_client pointer addr fix by ucwong · Pull Request #26727 · ethereum_go-ethereum

result is already a pointer, which may be nil. Your fix would unmarshal into the address of the pointer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct!!!

@ucwong ucwong closed this Feb 20, 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.

2 participants