Skip to content

Commit

Permalink
fix possible panic in guessApplicationType
Browse files Browse the repository at this point in the history
  • Loading branch information
def committed Jul 16, 2024
1 parent 5851fb3 commit 409c784
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions containers/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ var (

func guessApplicationType(cmdline []byte) string {
parts := bytes.Split(cmdline, []byte{0})
if len(parts) == 0 || len(parts[0]) == 0 {
return ""
}
cmd := bytes.TrimSuffix(bytes.Fields(parts[0])[0], []byte{':'})
switch {
case bytes.HasSuffix(cmd, []byte("memcached")):
Expand Down

0 comments on commit 409c784

Please sign in to comment.