Skip to content

Commit

Permalink
fix panic in instrumentPython (fixes #110)
Browse files Browse the repository at this point in the history
  • Loading branch information
def committed Jul 16, 2024
1 parent d135225 commit 69f9db2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion containers/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,11 @@ func (p *Process) instrumentPython(tracer *ebpftracer.Tracer) {
return
}
parts := bytes.Split(cmdline, []byte{0})
cmd := bytes.TrimSuffix(bytes.Fields(parts[0])[0], []byte{':'})
cmd := parts[0]
if len(cmd) == 0 {
return
}
cmd = bytes.TrimSuffix(bytes.Fields(cmd)[0], []byte{':'})
if !pythonCmd.Match(cmd) {
return
}
Expand Down

0 comments on commit 69f9db2

Please sign in to comment.