From 11812a8701dfb8409dd397848d8b24e60538b6f2 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 1ef4a36be3b4..e6346d36b320 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -2225,7 +2225,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]