From: Ian Lance Taylor Date: Wed, 17 Aug 2022 03:45:59 +0000 (-0700) Subject: debug/pe: fetch section size directly in (*Section).Data X-Git-Tag: go1.20rc1~1493 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=f3563bc55c7029473aeaf228171ecd06f1317532;p=gostls13.git 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 --- diff --git a/src/debug/pe/section.go b/src/debug/pe/section.go index 997f0ef714..fabb47af2e 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.