]> Cypherpunks repositories - gostls13.git/commitdiff
debug/pe: fetch section size directly in (*Section).Data
authorIan Lance Taylor <iant@golang.org>
Wed, 17 Aug 2022 03:45:59 +0000 (20:45 -0700)
committerGopher Robot <gobot@golang.org>
Fri, 19 Aug 2022 21:29:19 +0000 (21:29 +0000)
Change-Id: Idc1f8b3fb6b4b2fdcc6dade048cc14c53715319f
Reviewed-on: https://go-review.googlesource.com/c/go/+/424197
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
src/debug/pe/section.go

index 997f0ef714dee6f380e0b0b1fb49e7d932af1842..fabb47af2eae175964e91f4c5869ef3a2c552f85 100644 (file)
@@ -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.