Fix: IP-CIDR invalid payload crash

This commit is contained in:
Dreamacro
2019-03-30 14:11:59 +08:00
parent 531f487629
commit 2036f8cb7a
2 changed files with 20 additions and 8 deletions

View File

@ -38,6 +38,7 @@ func (i *IPCIDR) Payload() string {
func NewIPCIDR(s string, adapter string, isSourceIP bool) *IPCIDR {
_, ipnet, err := net.ParseCIDR(s)
if err != nil {
return nil
}
return &IPCIDR{
ipnet: ipnet,