Skip to content

Commit

Permalink
Merge pull request #138 from pegnet/hotfix-int64_threshold
Browse files Browse the repository at this point in the history
[Hotfix] Check for int64 overflow
  • Loading branch information
StarNeit authored Jul 22, 2020
2 parents 6662203 + 1b3fd75 commit 7a6d381
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 7a6d381

Please sign in to comment.