]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Nest: Assumption in rt-show for not-so-intuitive invariant.
authorMaria Matejka <mq@ucw.cz>
Sat, 17 Aug 2019 06:59:06 +0000 (08:59 +0200)
committerMaria Matejka <mq@ucw.cz>
Sat, 17 Aug 2019 11:51:32 +0000 (13:51 +0200)
nest/rt-show.c

index 5d112979081ae7120b5b529b7f1f5930ec79295e..0562ff5363a53a0fcca9fb58995c049c189afaa1 100644 (file)
@@ -106,6 +106,12 @@ rt_show_net(struct cli *c, net *n, struct rt_show_data *d)
   byte ia[NET_MAX_TEXT_LENGTH+1];
   struct ea_list *tmpa;
   struct channel *ec = d->tab->export_channel;
+
+  /* The Clang static analyzer complains that ec may be NULL.
+   * It should be ensured to be not NULL by rt_show_prepare_tables() */
+  if (d->export_mode)
+    ASSUME(ec);
+
   int first = 1;
   int pass = 0;