]> 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>
Mon, 17 Dec 2018 14:14:05 +0000 (12:14 -0200)
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 cd12edbccb1f9c47c30aadccd64f2684c9e93d27..871711312a5496f29c8b41a2434e256258ed58c4 100644 (file)
@@ -4844,6 +4844,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];