-
Notifications
You must be signed in to change notification settings - Fork 8.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FAB-2643] MsgCryptoSvc: NPE when no policyMgr found
Scenario: Peer gets an AliveMessage in gossip from an external organization, and the messageCryptoService tries to validate it. The validation first goes to the local MSP (and fails) so it tries validating using one of the channel policies (which were recently introduced), but it fails because the channelPolicyManagerGetter returns a nil policyManager from some reason. This results in a null dereference panic and the unexpected and sorrowful death of the peer. panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x756ff5] goroutine 45 [running]: panic(0xc1ad00, 0xc420016050) /opt/go/src/runtime/panic.go:500 +0x1a1 fabric/peer/gossip/mcs.(*mspMessageCryptoService).VerifyByChannel /opt/gopath/src/github.com/hyperledger/fabric/peer/gossip/mcs/mcs.go:234 github.com/hyperledger/fabric/peer/gossip/mcs.(*mspMessageCryptoService).Verify ... Full stacktrace available in the JIRA item. I added a nil check in 2 places and also added tests that check these corner cases. Change-Id: I3f45aff6cbf483258fcb4166f059e03647b947c8 Signed-off-by: Yacov Manevich <yacovm@il.ibm.com>
- Loading branch information
Showing
2 changed files
with
25 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters