Skip to content

Commit

Permalink
[FAB-5627] Missing checks at endorser.go
Browse files Browse the repository at this point in the history
There is a missing array bounds check that may cause the peer to crash.
Stack trace in the JIRA item.

Change-Id: Ie018f9160aeb2eef4e9075282e15271250b25e17
Signed-off-by: yacovm <yacovm@il.ibm.com>
(cherry picked from commit 3da11e2)
Signed-off-by: Gari Singh <gari.r.singh@gmail.com>
  • Loading branch information
yacovm authored and mastersingh24 committed Aug 5, 2017
1 parent 0631ccd commit 3abe144
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/endorser/endorser.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,10 @@ func (e *Endorser) disableJavaCCInst(cid *pb.ChaincodeID, cis *pb.ChaincodeInvoc
return nil
}

if argNo >= len(cis.ChaincodeSpec.Input.Args) {
return errors.New("Too few arguments passed")
}

//the inner dep spec will contain the type
cds, err := putils.GetChaincodeDeploymentSpec(cis.ChaincodeSpec.Input.Args[argNo])
if err != nil {
Expand Down

0 comments on commit 3abe144

Please sign in to comment.