From b4efa101a8a8354fe763d828bdd116cff89c60aa Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Mon, 25 Jan 2021 09:51:22 +0200 Subject: [PATCH] bgpd: Assert that community_str2com("no-export") always returns non-NULL community_str2com("no-export"); returns ALWAYS non-NULL. If NULL returned here, we really have a bigger problems in the call path. Signed-off-by: Donatas Abraitis --- bgpd/bgp_route.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index f7945ce140..e6276d060e 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -3516,6 +3516,8 @@ static void bgp_attr_add_no_export_community(struct attr *attr) old = attr->community; no_export = community_str2com("no-export"); + assert(no_export); + if (old) { merge = community_merge(community_dup(old), no_export); -- 2.39.5