Skip to content

Commit

Permalink
Fix code scanning alert #29: Incorrect conversion between integer types
Browse files Browse the repository at this point in the history
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
  • Loading branch information
1 parent f4c397a commit 0f5ca01
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libgo/go/net/http/pprof/pprof.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,10 @@ func Symbol(w http.ResponseWriter, r *http.Request) {
}
pc, _ := strconv.ParseUint(string(word), 0, 64)
if pc != 0 {
if pc > ^uint64(0)>>1 {
fmt.Fprintf(&buf, "address out of range: %v\n", pc)
continue
}
f := runtime.FuncForPC(uintptr(pc))
if f != nil {
fmt.Fprintf(&buf, "%#x %s\n", pc, f.Name())
Expand Down

0 comments on commit 0f5ca01

Please sign in to comment.