summaryrefslogtreecommitdiffstats
path: root/bgpd
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2018-06-21 13:29:51 +0200
committerGitHub <noreply@github.com>2018-06-21 13:29:51 +0200
commit50f08ff26a40f530148f210c1a55cfec4ec9d7d1 (patch)
tree549a218ae6751c089d3859bf06974f3d2207fc3c /bgpd
parentMerge pull request #2508 from pacovn/Coverity_1470113_Untrusted_array_index_w... (diff)
parentbgpd, lib: null check (Coverity 1436344, 1451361) (diff)
downloadfrr-50f08ff26a40f530148f210c1a55cfec4ec9d7d1.tar.xz
frr-50f08ff26a40f530148f210c1a55cfec4ec9d7d1.zip
Merge pull request #2507 from pacovn/Coverity_1436344_1451361_Dereference_after_null_check
bgpd, lib: null check (Coverity 1436344, 1451361)
Diffstat (limited to 'bgpd')
-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);