Skip to content

Commit

Permalink
adapter linux/arm64, check _func.nameoff array bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
pkujhd committed Feb 18, 2021
1 parent 3ed968e commit ba664a3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions register.1.16.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ func registerFunc(md *moduledata, symPtr map[string]uintptr) {
for _, f := range md.ftab {
if int(f.funcoff) < len(md.pclntable) {
_func := (*_func)(unsafe.Pointer((&(md.pclntable[f.funcoff]))))
name := gostringnocopy(&(md.funcnametab[_func.nameoff]))
if !strings.HasPrefix(name, TypeDoubleDotPrefix) && _func.entry < md.etext {
symPtr[name] = _func.entry
if int(_func.nameoff) < len(md.funcnametab) {
name := gostringnocopy(&(md.funcnametab[_func.nameoff]))
if !strings.HasPrefix(name, TypeDoubleDotPrefix) && _func.entry < md.etext {
symPtr[name] = _func.entry
}
}
}
}
Expand Down

0 comments on commit ba664a3

Please sign in to comment.