From b8236888d4d749d865eccac8cb628120e4e5f8e5 Mon Sep 17 00:00:00 2001 From: Daniel Liu Date: Tue, 25 Jun 2024 17:07:59 +0800 Subject: [PATCH] internal/ethapi: avoid int overflow in GetTransactionReceipt (#26911) --- internal/ethapi/api.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 53678ebf6414..677f3ed5e929 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -2231,7 +2231,7 @@ func (s *PublicTransactionPoolAPI) GetTransactionReceipt(ctx context.Context, ha if err != nil { return nil, err } - if len(receipts) <= int(index) { + if uint64(len(receipts)) <= index { return nil, nil } receipt := receipts[index]