forked from TrueCloudLab/neoneo-go
native: check that oracle request GAS IsInt64()
We use int64 value down below, so check for IsInt64() while MinimumResponseGas check still covers for values less than zero.
This commit is contained in:
parent
5f13de3a76
commit
79b1bf72aa
1 changed files with 2 additions and 2 deletions
|
@ -329,10 +329,10 @@ func (o *Oracle) request(ic *interop.Context, args []stackitem.Item) stackitem.I
|
|||
|
||||
// RequestInternal processes oracle request.
|
||||
func (o *Oracle) RequestInternal(ic *interop.Context, url string, filter *string, cb string, userData stackitem.Item, gas *big.Int) error {
|
||||
if len(url) > maxURLLength || (filter != nil && len(*filter) > maxFilterLength) || len(cb) > maxCallbackLength {
|
||||
if len(url) > maxURLLength || (filter != nil && len(*filter) > maxFilterLength) || len(cb) > maxCallbackLength || !gas.IsInt64() {
|
||||
return ErrBigArgument
|
||||
}
|
||||
if gas.Uint64() < MinimumResponseGas {
|
||||
if gas.Int64() < MinimumResponseGas {
|
||||
return ErrLowResponseGas
|
||||
}
|
||||
if strings.HasPrefix(cb, "_") {
|
||||
|
|
Loading…
Add table
Reference in a new issue