Skip to content

Commit

Permalink
FAB18529 added nil check in channel header parsing
Browse files Browse the repository at this point in the history
Fuzz testing has reported SEGV while sending incomplete/null
message request to orderer.

Signed-off-by: Parameswaran Selvam <parselva@in.ibm.com>
  • Loading branch information
Param-S committed Aug 19, 2021
1 parent bb8bada commit ebf94b1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions protoutil/commonutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,10 @@ func IsConfigBlock(block *cb.Block) bool {

// ChannelHeader returns the *cb.ChannelHeader for a given *cb.Envelope.
func ChannelHeader(env *cb.Envelope) (*cb.ChannelHeader, error) {
if env == nil {
return nil, errors.New("Invalid envelope payload. can't be nil")
}

envPayload, err := UnmarshalPayload(env.Payload)
if err != nil {
return nil, err
Expand Down

0 comments on commit ebf94b1

Please sign in to comment.