Skip to content

Commit

Permalink
Nil check for stack traces
Browse files Browse the repository at this point in the history
Signed-off-by: grantseltzer <[email protected]>
  • Loading branch information
grantseltzer committed Dec 12, 2024
1 parent 9247360 commit 26663d4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/dynamicinstrumentation/uploader/stack_trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ func pcToLine(procInfo *ditypes.ProcessInfo, pc uint64) (*funcInfo, error) {
return nil, fmt.Errorf("invalid file number in dwarf function entry associated with compile unit")
}

if int(fileNumber) >= len(files) || files[fileNumber] == nil {
return nil, fmt.Errorf("could not find file")
}
file = files[fileNumber].Name

return &funcInfo{
Expand Down

0 comments on commit 26663d4

Please sign in to comment.