From 4392a1c4e6d4ccc98f4e773a7d8a009b8ccd143e Mon Sep 17 00:00:00 2001 From: Danno Ferrin Date: Tue, 17 Sep 2024 15:44:04 -0600 Subject: [PATCH] Fix dangling data in container for initcode --- core/vm/eof.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/vm/eof.go b/core/vm/eof.go index 5808fd2c792b..9423495c03a5 100644 --- a/core/vm/eof.go +++ b/core/vm/eof.go @@ -245,7 +245,7 @@ func (c *Container) unmarshalContainer(b []byte, isInitcode bool, topLevel bool) return fmt.Errorf("%w: have %d, want %d", ErrInvalidContainerSize, len(b), expectedSize) } // Only check that the expected size is not exceed on non-initcode - if !isInitcode && len(b) > expectedSize { + if (!topLevel || !isInitcode) && len(b) > expectedSize { return fmt.Errorf("%w: have %d, want %d", ErrInvalidContainerSize, len(b), expectedSize) }