No test case because the problem can only happen for invalid data.
Let the fuzzer find cases like this.
Fixes #63610
Change-Id: I797b4d9bdb08286ad3e3a9a6f800ee8c90cb7261
Reviewed-on: https://go-review.googlesource.com/c/go/+/536400
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com>
if err != nil {
return nil, err
}
+
+ dynSize := 8
+ if f.Class == ELFCLASS64 {
+ dynSize = 16
+ }
+ if len(d)%dynSize != 0 {
+ return nil, errors.New("length of dynamic section is not a multiple of dynamic entry size")
+ }
+
str, err := f.stringTable(ds.Link)
if err != nil {
return nil, err