]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Kernel: Fix crash for merge paths on if no route is in BIRD
authorMaria Matejka <mq@ucw.cz>
Thu, 19 Dec 2024 10:00:15 +0000 (11:00 +0100)
committerMaria Matejka <mq@ucw.cz>
Thu, 19 Dec 2024 10:38:27 +0000 (11:38 +0100)
There was a missing check for a NULL return value.
Also fixed an indenting error.

Thanks to Radu Anghel for reporting it:
https://bird.network.cz/pipermail/bird-users/2024-December/017977.html

nest/rt-table.c

index fd8bb50ddfb63f02e50750d388d91bc3303d6be2..05191d7437ebed5fe3b93c3c68f53ec0b0af4e36 100644 (file)
@@ -5265,14 +5265,14 @@ krt_export_net(struct channel *c, const net_addr *a, linpool *lp)
   if (c->ra_mode == RA_MERGED)
   {
     struct rt_export_feed *feed = rt_net_feed(c->table, a, NULL);
-    if (!feed->count_routes)
+    if (!feed || !feed->count_routes)
       return NULL;
 
     if (!bmap_test(&c->export_accepted_map, feed->block[0].id))
       return NULL;
 
     return rt_export_merged(c, feed, lp, 1);
-    }
+  }
 
   static _Thread_local rte best;
   best = rt_net_best(c->table, a);