coreos / go-iptables

Go wrapper around iptables utility
Apache License 2.0
1.14k stars 257 forks source link

Panic: when target is empty #88

Open Fan-chou opened 3 years ago

Fan-chou commented 3 years ago
❯ iptables -A OUTPUT -d 1.0.0.1
❯ iptables -t filter -L OUTPUT -n -v -x --wait
Chain OUTPUT (policy ACCEPT * packets, * bytes)
    pkts      bytes target     prot opt in     out     source               destination
       0        0            tcp  --  *      *       0.0.0.0/0            1.0.0.1

Like this traget is empty, so len(fiels[]) == 8 in now.

https://github.com/coreos/go-iptables/blob/14d56d57c892f27a717aa6026fd2d3293221395b/iptables/iptables.go#L329