]> 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>
Fri, 1 May 2020 13:19:12 +0000 (15:19 +0200)
nest/rt-show.c

index 3431293a152830a67831ee7421c8e4f54a342c33..bd0df9ee678010c0adda0d71b8dddae9f74cb6b0 100644 (file)
@@ -104,6 +104,12 @@ rt_show_net(struct cli *c, net *n, struct rt_show_data *d)
   rte *e, *ee;
   byte ia[NET_MAX_TEXT_LENGTH+1];
   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;