You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[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 <[email protected]>
0 commit comments