We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3954259 commit bf2e341Copy full SHA for bf2e341
core/vm/contracts.go
@@ -591,8 +591,11 @@ func (c *bigModExp) RequiredGas(input []byte) uint64 {
591
if expLen > 32 {
592
expHead.SetBytes(getData(input, baseLen, 32))
593
} else {
594
- // TODO: Check that if expLen < baseLen, then getData will return an empty slice
595
- expHead.SetBytes(getData(input, baseLen, expLen))
+ if expLen < baseLen && uint64(len(input)) < baseLen+expLen {
+ expHead.SetBytes([]byte{})
596
+ } else {
597
+ expHead.SetBytes(getData(input, baseLen, expLen))
598
+ }
599
}
600
601
0 commit comments