diff options
author | Donald Sharp <sharpd@nvidia.com> | 2023-05-31 01:30:12 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@nvidia.com> | 2023-06-01 14:54:25 +0200 |
commit | 1f7038386e34fac1731014535bfea6a0b3892abc (patch) | |
tree | 1a8db95ebd6f8d31c92b04ab399f52903c450552 /bgpd | |
parent | Merge pull request #13652 from opensourcerouting/fix/drop_old_releases_from_t... (diff) | |
download | frr-1f7038386e34fac1731014535bfea6a0b3892abc.tar.xz frr-1f7038386e34fac1731014535bfea6a0b3892abc.zip |
bgpd: community_list_set str is always non null
When calling community_list_set the str variable is
always non NULL. As such let's treat it as such.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'bgpd')
-rw-r--r-- | bgpd/bgp_clist.c | 14 | ||||
-rw-r--r-- | bgpd/bgp_vty.c | 2 |
2 files changed, 8 insertions, 8 deletions
diff --git a/bgpd/bgp_clist.c b/bgpd/bgp_clist.c index 1d2ba3bf5..ac5cdd6ac 100644 --- a/bgpd/bgp_clist.c +++ b/bgpd/bgp_clist.c @@ -899,15 +899,13 @@ int community_list_set(struct community_list_handler *ch, const char *name, } } - if (str) { - if (style == COMMUNITY_LIST_STANDARD) - com = community_str2com(str); - else - regex = bgp_regcomp(str); + if (style == COMMUNITY_LIST_STANDARD) + com = community_str2com(str); + else + regex = bgp_regcomp(str); - if (!com && !regex) - return COMMUNITY_LIST_ERR_MALFORMED_VAL; - } + if (!com && !regex) + return COMMUNITY_LIST_ERR_MALFORMED_VAL; entry = community_entry_new(); entry->direct = direct; diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index 7ef9db9f0..89a5333a2 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -20663,6 +20663,7 @@ DEFUN (community_list_standard, argv_find(argv, argc, "AA:NN", &idx); char *str = argv_concat(argv, argc, idx); + assert(str); int ret = community_list_set(bgp_clist, cl_name_or_number, str, seq, direct, style); @@ -20775,6 +20776,7 @@ DEFUN (community_list_expanded_all, argv_find(argv, argc, "AA:NN", &idx); char *str = argv_concat(argv, argc, idx); + assert(str); int ret = community_list_set(bgp_clist, cl_name_or_number, str, seq, direct, style); |