Merge pull request #16136 from FRRouting/mergify/bp/stable/9.0/pr-16111

ospf6d: Prevent heap-buffer-overflow with unknown type (backport #16111)
This commit is contained in:
Donald Sharp 2024-06-01 10:04:40 -04:00 committed by GitHub
commit db613bd7e7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -176,6 +176,7 @@ static int ospf6_extract_grace_lsa_fields(struct ospf6_lsa *lsa,
return OSPF6_FAILURE; return OSPF6_FAILURE;
break; break;
default: default:
sum += TLV_SIZE(tlvh);
if (IS_DEBUG_OSPF6_GR) if (IS_DEBUG_OSPF6_GR)
zlog_debug("%s, Ignoring unknown TLV type:%d", zlog_debug("%s, Ignoring unknown TLV type:%d",
__func__, ntohs(tlvh->type)); __func__, ntohs(tlvh->type));