From: Igor Ryzhov Date: Thu, 12 Aug 2021 16:07:53 +0000 (+0300) Subject: bgpd: fix segfault when re-adding "match evpn default-route" rule X-Git-Tag: base_8.1~185^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=30475121ad590f8e44ebb2601776ae94df976069;p=mirror%2Ffrr.git bgpd: fix segfault when re-adding "match evpn default-route" rule When using "match evpn default-route" rule, match_arg is NULL and strcmp is not happy with that. There's already a special function named rulecmp that handles such situations. Signed-off-by: Igor Ryzhov --- diff --git a/lib/routemap.c b/lib/routemap.c index 5d45dc1047..594dcf97cb 100644 --- a/lib/routemap.c +++ b/lib/routemap.c @@ -1431,7 +1431,7 @@ enum rmap_compile_rets route_map_add_match(struct route_map_index *index, * the same as the existing configuration then, * ignore the duplicate configuration. */ - if (strcmp(match_arg, rule->rule_str) == 0) { + if (rulecmp(match_arg, rule->rule_str) == 0) { if (cmd->func_free) (*cmd->func_free)(compile);