From 3ec25cbece63d929a8ea06b3572e429393e47f54 Mon Sep 17 00:00:00 2001 From: Lucas Molas Date: Mon, 9 Nov 2020 22:12:32 -0300 Subject: [PATCH] restrict parse fil string length (#4780) --- chain/types/fil.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/chain/types/fil.go b/chain/types/fil.go index 0ea77660c..3dabb5e77 100644 --- a/chain/types/fil.go +++ b/chain/types/fil.go @@ -61,6 +61,10 @@ func ParseFIL(s string) (FIL, error) { } } + if len(s) > 50 { + return FIL{}, fmt.Errorf("string length too large: %d", len(s)) + } + r, ok := new(big.Rat).SetString(s) if !ok { return FIL{}, fmt.Errorf("failed to parse %q as a decimal number", s)