From f3563bc55c7029473aeaf228171ecd06f1317532 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 16 Aug 2022 20:45:59 -0700 Subject: [PATCH] debug/pe: fetch section size directly in (*Section).Data Change-Id: Idc1f8b3fb6b4b2fdcc6dade048cc14c53715319f Reviewed-on: https://go-review.googlesource.com/c/go/+/424197 Run-TryBot: Ian Lance Taylor Reviewed-by: Ian Lance Taylor TryBot-Result: Gopher Robot Auto-Submit: Ian Lance Taylor Reviewed-by: Dmitri Shuralyov Run-TryBot: Ian Lance Taylor Reviewed-by: Dmitri Shuralyov --- src/debug/pe/section.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/debug/pe/section.go b/src/debug/pe/section.go index 997f0ef714d..fabb47af2ea 100644 --- a/src/debug/pe/section.go +++ b/src/debug/pe/section.go @@ -98,7 +98,7 @@ type Section struct { // Data reads and returns the contents of the PE section s. func (s *Section) Data() ([]byte, error) { - return saferio.ReadDataAt(s.sr, uint64(s.sr.Size()), 0) + return saferio.ReadDataAt(s.sr, uint64(s.Size), 0) } // Open returns a new ReadSeeker reading the PE section s.