1
0
mirror of https://github.com/golang/go synced 2024-11-22 19:05:01 -07:00

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 <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>
This commit is contained in:
Ian Lance Taylor 2022-08-16 20:45:59 -07:00 committed by Gopher Robot
parent 375a80c9ef
commit f3563bc55c

View 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.