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 rpc.go crash (issue #85) #86

Merged
merged 1 commit into from
Jul 15, 2019
Merged

Conversation

ahothan
Copy link
Contributor

@ahothan ahothan commented Jul 13, 2019

#85

This patch fixes the occasional crash that happens in rpc.go.
The crash occurs when a reply is coming back fragmented and socket read returns an incomplete
length field or header field.
The original code is incorrect as the read loop writes at the start of the buffer at every iteration when it should write at the next position (passed the bytes already read).
ReadFull() will actually do just what is needed.

I have tested the patch and it fixes the crash (which could be reproduce very easily with prior code).

@benlemasurier
Copy link
Contributor

Thank you!

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.

None yet

2 participants