Skip to content

Commit

Permalink
cast arguments data conditionally on type
Browse files Browse the repository at this point in the history
Signed-off-by: rksharma95 <ramakant@accuknox.com>
  • Loading branch information
rksharma95 committed Dec 21, 2024
1 parent 2691fa2 commit a484a96
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion KubeArmor/monitor/systemMonitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,16 @@ func (mon *SystemMonitor) TraceSyscall() {
}

// build a pid node
pidNode := mon.BuildPidNode(containerID, ctx, execPath, args[2].([]string))
args_2 := []string{}
switch v := args[2].(type) {
case []string:
args_2 = append(args_2, v...)
case string:
args_2 = append(args_2, v)
default:
mon.Logger.Warnf("Unexpected args[2] type")
}
pidNode := mon.BuildPidNode(containerID, ctx, execPath, args_2)
mon.AddActivePid(containerID, pidNode)

fd := ""
Expand Down

0 comments on commit a484a96

Please sign in to comment.