Skip to content

Commit 0f21fca

Browse files
committed
check utf8 string in GetFeeQuoterTokenUpdates
1 parent 8caef18 commit 0f21fca

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

pkg/ccip/chainaccessor/ton_accessor.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"math/big"
1010
"sync"
1111
"time"
12+
"unicode/utf8"
1213

1314
"github.com/xssnick/tonutils-go/address"
1415
"github.com/xssnick/tonutils-go/tlb"
@@ -774,6 +775,9 @@ func (a *TONAccessor) GetFeeQuoterTokenUpdates(
774775
default:
775776
return nil, fmt.Errorf("expected either cell or nil, received %T", priceResult)
776777
}
778+
if !utf8.ValidString(token.String()) {
779+
return nil, fmt.Errorf("gRPC can't handle non-UTF8 strings: %x", token)
780+
}
777781
prices[ccipocr3.UnknownEncodedAddress(token)] = price
778782
}
779783
return prices, nil

0 commit comments

Comments
 (0)