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 #1037

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:20
@yacovm yacovm changed the title Properly handle malformed gossip envelopes [FAB-17726] Properly handle malformed gossip envelopes Apr 9, 2020
@C0rWin C0rWin merged commit 9007739 into hyperledger:release-1.4 Apr 9, 2020
@yacovm yacovm deleted the gossipNPE-1.4 branch April 23, 2020 21:37
C0rWin pushed a commit to C0rWin/fabric that referenced this pull request Sep 15, 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>
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