summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_clist.c
diff options
context:
space:
mode:
authorpaco <paco@voltanet.io>2018-06-20 19:11:18 +0200
committerpaco <paco@voltanet.io>2018-06-20 19:14:01 +0200
commitfa3016309b33395c02cf10e7e198517c5b81e55a (patch)
tree0de837fc4e142d8b479766f79212d50688bdd3c3 /bgpd/bgp_clist.c
parentMerge pull request #2498 from pacovn/Coverity_1470098_Logically_dead_code (diff)
downloadfrr-fa3016309b33395c02cf10e7e198517c5b81e55a.tar.xz
frr-fa3016309b33395c02cf10e7e198517c5b81e55a.zip
bgpd, lib: null check (Coverity 1436344, 1451361)
Signed-off-by: F. Aragon <paco@voltanet.io>
Diffstat (limited to 'bgpd/bgp_clist.c')
-rw-r--r--bgpd/bgp_clist.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/bgpd/bgp_clist.c b/bgpd/bgp_clist.c
index 7cf147754..0ffbe174e 100644
--- a/bgpd/bgp_clist.c
+++ b/bgpd/bgp_clist.c
@@ -1054,6 +1054,9 @@ int extcommunity_list_set(struct community_list_handler *ch, const char *name,
struct ecommunity *ecom = NULL;
regex_t *regex = NULL;
+ if (str == NULL)
+ return COMMUNITY_LIST_ERR_MALFORMED_VAL;
+
entry = NULL;
/* Get community list. */
@@ -1089,7 +1092,7 @@ int extcommunity_list_set(struct community_list_handler *ch, const char *name,
entry = community_entry_new();
entry->direct = direct;
entry->style = style;
- entry->any = (str ? 0 : 1);
+ entry->any = 0;
if (ecom)
entry->config = ecommunity_ecom2str(
ecom, ECOMMUNITY_FORMAT_COMMUNITY_LIST, 0);