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

[FAB-17726] Properly handle malformed gossip envelopes #1039

Merged
merged 1 commit into from
Apr 9, 2020

Conversation

yacovm
Copy link
Contributor

@yacovm yacovm commented Apr 9, 2020

If a malformed envelope is read from the stream, an error is propagated
synchronously up the stack.

However, the envelope is unmarshaled into a nil
message which is also propagated further up the stack asynchronously.

Under very rare circumstances, the error is picked up later than
the message, and a nil pointer panic occurs.

This patch fixes this by returning early in case of an error.

Change-Id: Ia17767ec2483d83d5fa4e7e22514c539232108a8
Signed-off-by: yacovm yacovm@il.ibm.com

If a malformed envelope is read from the stream, an error is propagated
synchronously up the stack.

However, the envelope is unmarshaled into a nil
message which is also propagated further up the stack asynchronously.

Under very rare circumstances, the error is picked up later than
the message, and a nil pointer panic occurs.

This patch fixes this by returning early in case of an error.

Change-Id: Ia17767ec2483d83d5fa4e7e22514c539232108a8
Signed-off-by: yacovm <yacovm@il.ibm.com>
@yacovm yacovm requested a review from a team as a code owner April 9, 2020 11:25
@yacovm yacovm changed the title Properly handle malformed gossip envelopes [FAB-17726] Properly handle malformed gossip envelopes Apr 9, 2020
@C0rWin C0rWin merged commit 5358d6e into hyperledger:release-2.1 Apr 9, 2020
@yacovm yacovm deleted the gossipNPE-2.1 branch April 23, 2020 21:36
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