From 9e773aa3e19785189e330d9742b3375cfedf096b Mon Sep 17 00:00:00 2001 From: FUJITA Tomonori Date: Wed, 9 Mar 2016 06:35:32 -0800 Subject: policy: fix crash to remove statement from policy without statements https://github.com/osrg/gobgp/issues/754 Signed-off-by: FUJITA Tomonori --- table/policy.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/table/policy.go b/table/policy.go index 20ae16cd..2e0550c6 100644 --- a/table/policy.go +++ b/table/policy.go @@ -2489,7 +2489,7 @@ func (lhs *Policy) Add(rhs *Policy) error { } func (lhs *Policy) Remove(rhs *Policy) error { - stmts := make([]*Statement, 0, len(lhs.Statements)-len(rhs.Statements)) + stmts := make([]*Statement, 0, len(lhs.Statements)) for _, x := range lhs.Statements { found := false for _, y := range rhs.Statements { -- cgit v1.2.3