Skip to content

Commit

Permalink
check nft rule lenght
Browse files Browse the repository at this point in the history
  • Loading branch information
Omarabdul3ziz committed Dec 31, 2024
1 parent b8b84ce commit afc70ec
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/netlight/nft/nft.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ func Apply(r io.Reader, ns string) error {
}

func applyNftRule(rule []string) error {
if len(rule) == 0 {
return errors.New("invalid nft rule")
}
cmd := exec.Command(rule[0], rule[1:]...)

out, err := cmd.CombinedOutput()
Expand Down

0 comments on commit afc70ec

Please sign in to comment.