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>
(cherry picked from commit 540fff8)
  • Loading branch information
Param-S authored and denyeart committed Aug 20, 2021
1 parent 9a6b351 commit fbf7b93
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 fbf7b93

Please sign in to comment.