From df2c1f3d4219404ad9e0a327e6d106022f4c4e71 Mon Sep 17 00:00:00 2001 From: Renato Westphal Date: Thu, 3 Dec 2020 12:19:06 -0300 Subject: [PATCH] isisd: fix null pointer dereference when parsing LSP 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 --- isisd/isis_tlvs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/isisd/isis_tlvs.c b/isisd/isis_tlvs.c index af419961d5..a97c19a8bc 100644 --- a/isisd/isis_tlvs.c +++ b/isisd/isis_tlvs.c @@ -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; -- 2.39.5