]> git.proxmox.com Git - mirror_frr.git/commitdiff
isisd: fix null pointer dereference when parsing LSP
authorRenato Westphal <renato@opensourcerouting.org>
Thu, 3 Dec 2020 15:19:06 +0000 (12:19 -0300)
committerRenato Westphal <renato@opensourcerouting.org>
Wed, 9 Dec 2020 15:21:33 +0000 (12:21 -0300)
In some extraordinary circumstances an LSP might not have any
TLV. Add a null check to prevent a crash when that happens.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
isisd/isis_tlvs.c

index af419961d56fb7974306de28ec3b6a23a20e7471..a97c19a8bc54fa4e19b37ff9eb7f931a69e0df65 100644 (file)
@@ -4850,7 +4850,7 @@ void isis_tlvs_add_spine_leaf(struct isis_tlvs *tlvs, uint8_t tier,
 struct isis_mt_router_info *
 isis_tlvs_lookup_mt_router_info(struct isis_tlvs *tlvs, uint16_t mtid)
 {
-       if (tlvs->mt_router_info_empty)
+       if (!tlvs || tlvs->mt_router_info_empty)
                return NULL;
 
        struct isis_mt_router_info *rv;