From c53814c223dd86ffcc7426bdfa0db68aeb537983 Mon Sep 17 00:00:00 2001 From: anim001k <140460766+anim001k@users.noreply.github.com> Date: Fri, 26 Sep 2025 20:00:15 +0200 Subject: [PATCH] Update util.go --- eth/tracers/internal/util.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eth/tracers/internal/util.go b/eth/tracers/internal/util.go index 88a9f5db44..cd22e2158b 100644 --- a/eth/tracers/internal/util.go +++ b/eth/tracers/internal/util.go @@ -53,7 +53,8 @@ func memoryCopy(m []byte, offset, size int64) (cpy []byte) { return nil } - if len(m) > int(offset) { + // Check that we have enough data in the slice to safely copy the requested range + if len(m) > int(offset) && int(offset+size) <= len(m) { cpy = make([]byte, size) copy(cpy, m[offset:offset+size])