Skip to content

Commit 3abe144

Browse files
yacovmmastersingh24
authored andcommitted
[FAB-5627] Missing checks at endorser.go
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 <[email protected]> (cherry picked from commit 3da11e2) Signed-off-by: Gari Singh <[email protected]>
1 parent 0631ccd commit 3abe144

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

core/endorser/endorser.go

+4
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,10 @@ func (e *Endorser) disableJavaCCInst(cid *pb.ChaincodeID, cis *pb.ChaincodeInvoc
185185
return nil
186186
}
187187

188+
if argNo >= len(cis.ChaincodeSpec.Input.Args) {
189+
return errors.New("Too few arguments passed")
190+
}
191+
188192
//the inner dep spec will contain the type
189193
cds, err := putils.GetChaincodeDeploymentSpec(cis.ChaincodeSpec.Input.Args[argNo])
190194
if err != nil {

0 commit comments

Comments
 (0)