]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd, lib: null check (Coverity 1436344, 1451361)
authorpaco <paco@voltanet.io>
Wed, 20 Jun 2018 17:11:18 +0000 (19:11 +0200)
committerpaco <paco@voltanet.io>
Wed, 20 Jun 2018 17:14:01 +0000 (19:14 +0200)
Signed-off-by: F. Aragon <paco@voltanet.io>
bgpd/bgp_clist.c
lib/command_match.c

index 7cf14775496cdb2bb6e8f0cc9eb04f2c5bb20b31..0ffbe174ed9d609579c4201684cc55cf53ada050 100644 (file)
@@ -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);
index 99ec03e0c2486d3e4a3f9c1aa03b6a35f7bcbd06..4893ead0421a830631cbfcc1089fc1ae7913906c 100644 (file)
@@ -609,6 +609,7 @@ static struct list *disambiguate(struct list *first, struct list *second,
                                 vector vline, unsigned int n)
 {
        // doesn't make sense for these to be inequal length
+       assert(first && second);
        assert(first->count == second->count);
        assert(first->count == vector_active(vline) - n + 1);