Skip to content

Commit

Permalink
check for int64 overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
WhoSoup committed Jul 22, 2020
1 parent 6662203 commit 1b3fd75
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions fat/fat2/transactionbatch.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ package fat2

import (
"encoding/json"
"errors"
"fmt"
"math"

"github.com/Factom-Asset-Tokens/factom"
"github.com/Factom-Asset-Tokens/factom/fat103"
Expand Down Expand Up @@ -109,6 +111,13 @@ func (t *TransactionBatch) Validate(height int32) error {
if err = t.ValidExtIDs(height); err != nil {
return err
}

for _, t := range t.Transactions {
if t.Input.Amount > math.MaxInt64 {
return errors.New("input value exceeded int64")
}
}

return nil
}

Expand Down

0 comments on commit 1b3fd75

Please sign in to comment.