Skip to content

Commit

Permalink
[FAB-9915]: Validate PrivateDataMessage payload
Browse files Browse the repository at this point in the history
This commit adds validation for private data payload field.

Change-Id: If3aa126dfa7470b6e481c910416f4b71dc733c63
Signed-off-by: Artem Barger <bartem@il.ibm.com>
  • Loading branch information
C0rWin committed May 6, 2018
1 parent fb60186 commit 6bb560e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions gossip/state/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,11 @@ func (s *GossipStateProviderImpl) privateDataMessage(msg proto.ReceivedMessage)
gossipMsg := msg.GetGossipMessage()
pvtDataMsg := gossipMsg.GetPrivateData()

if pvtDataMsg.Payload == nil {
logger.Warning("Malformed private data message, no payload provided")
return
}

collectionName := pvtDataMsg.Payload.CollectionName
txID := pvtDataMsg.Payload.TxId
pvtRwSet := pvtDataMsg.Payload.PrivateRwset
Expand Down

0 comments on commit 6bb560e

Please sign in to comment.