]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: don't print uninitialized string (3b02fe8)
authorDavid Lamparter <equinox@opensourcerouting.org>
Sat, 7 Mar 2015 07:40:48 +0000 (08:40 +0100)
committerDonald Sharp <sharpd@cumulusnetwroks.com>
Thu, 26 May 2016 00:38:34 +0000 (20:38 -0400)
This crept in as part of the MRIB improvements and I missed the compiler
warning between other noise.  Unfortunately, printing an uninitialised
variable can in fact make zebra crash, so this is not trivial.

Fixes: 3b02fe8 ("zebra: add "show ip rpf" to get result of RPF lookup")
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
zebra/zebra_vty.c

index 60e793d0af94c00acac0cc4e3fb16d829fe35007..7addb3509e7c2362bda467a0231b6f77488accb3 100644 (file)
@@ -1916,7 +1916,7 @@ vty_show_ip_route_detail (struct vty *vty, struct route_node *rn, int mcast)
 
   RNODE_FOREACH_RIB (rn, rib)
     {
-      const char *mcast_info;
+      const char *mcast_info = "";
       if (mcast)
         {
           rib_table_info_t *info = rn->table->info;
@@ -1924,8 +1924,6 @@ vty_show_ip_route_detail (struct vty *vty, struct route_node *rn, int mcast)
                        ? " using Multicast RIB"
                        : " using Unicast RIB";
         }
-      else
-       mcast_info = "";
       
       vty_out (vty, "Routing entry for %s/%d%s%s",
               inet_ntoa (rn->p.u.prefix4), rn->p.prefixlen, mcast_info,