diff options
author | zvfvrv <franclombardo@gmail.com> | 2021-07-21 12:26:30 +0200 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@gmail.com> | 2021-07-25 08:18:26 +0900 |
commit | 188778603e9e0d4ba14adb93e2602a959b01bd7e (patch) | |
tree | 43db8e6622ea7a6bc81597d57016d049645f31b7 | |
parent | b284a8082ab4a088677e0dd0c5a4b6f0c9add592 (diff) |
fixed possible crash if nlriToIPNet result is null
-rw-r--r-- | internal/pkg/table/policy.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/internal/pkg/table/policy.go b/internal/pkg/table/policy.go index 409989a0..958342a1 100644 --- a/internal/pkg/table/policy.go +++ b/internal/pkg/table/policy.go @@ -1453,6 +1453,9 @@ func (c *PrefixCondition) Evaluate(path *Path, _ *PolicyOptions) bool { } r := nlriToIPNet(path.GetNlri()) + if r == nil { + return false + } ones, _ := r.Mask.Size() masklen := uint8(ones) result := false |