]> git.proxmox.com Git - mirror_frr.git/commitdiff
bgpd: fix NULL pointer dereference bug
authorRenato Westphal <renato@opensourcerouting.org>
Fri, 19 Oct 2018 18:55:03 +0000 (15:55 -0300)
committerRenato Westphal <renato@opensourcerouting.org>
Sat, 20 Oct 2018 15:39:05 +0000 (12:39 -0300)
Other parts of the rfapi code check if the 'rfg->rfapi_import_table'
pointer is NULL or not before using it. Do the same here to fix a crash
detected by the CLI fuzzer.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
bgpd/rfapi/rfapi_vty.c

index cdf281f240b8749bc9eea72ad82de6dc0d65e3c5..1844839f25938eb2ac219ec351e850b1f67cd716 100644 (file)
@@ -4845,6 +4845,10 @@ DEFUN (add_vrf_prefix_rd_label_pref,
 static int rfapi_cfg_group_it_count(struct rfapi_nve_group_cfg *rfg)
 {
        int count = 0;
+
+       if (rfg->rfapi_import_table == NULL)
+               return 0;
+
        afi_t afi = AFI_MAX;
        while (afi-- > 0) {
                count += rfg->rfapi_import_table->local_count[afi];