Skip to content

Commit 7a6d381

Browse files
authored
Merge pull request #138 from pegnet/hotfix-int64_threshold
[Hotfix] Check for int64 overflow
2 parents 6662203 + 1b3fd75 commit 7a6d381

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

fat/fat2/transactionbatch.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ package fat2
22

33
import (
44
"encoding/json"
5+
"errors"
56
"fmt"
7+
"math"
68

79
"github.com/Factom-Asset-Tokens/factom"
810
"github.com/Factom-Asset-Tokens/factom/fat103"
@@ -109,6 +111,13 @@ func (t *TransactionBatch) Validate(height int32) error {
109111
if err = t.ValidExtIDs(height); err != nil {
110112
return err
111113
}
114+
115+
for _, t := range t.Transactions {
116+
if t.Input.Amount > math.MaxInt64 {
117+
return errors.New("input value exceeded int64")
118+
}
119+
}
120+
112121
return nil
113122
}
114123

0 commit comments

Comments
 (0)