Fix: crash when ip is nil

This commit is contained in:
gVisor bot 2019-02-12 12:29:33 +08:00
parent 3ea1046c4f
commit fde2ae7764

View file

@ -24,7 +24,7 @@ func (i *IPCIDR) IsMatch(metadata *C.Metadata) bool {
if i.isSourceIP {
ip = metadata.SourceIP
}
return i.ipnet.Contains(*ip)
return ip != nil && i.ipnet.Contains(*ip)
}
func (i *IPCIDR) Adapter() string {