Add header size check for safe. If the check fails, just jump out of current
function.
Signed-off-by: anlan_cs <vic.lan@pica8.com>
int sum = 0;
lsah = (struct ospf6_lsa_header *)lsa->header;
+ if (ntohs(lsah->length) <= OSPF6_LSA_HEADER_SIZE) {
+ if (IS_DEBUG_OSPF6_GR)
+ zlog_debug("%s: undersized (%u B) lsa", __func__,
+ ntohs(lsah->length));
+ return OSPF6_FAILURE;
+ }
length = ntohs(lsah->length) - OSPF6_LSA_HEADER_SIZE;
int sum = 0;
lsah = (struct ospf6_lsa_header *)lsa->header;
+ if (ntohs(lsah->length) <= OSPF6_LSA_HEADER_SIZE) {
+ if (IS_DEBUG_OSPF6_GR)
+ zlog_debug("%s: undersized (%u B) lsa", __func__,
+ ntohs(lsah->length));
+ return OSPF6_FAILURE;
+ }
length = ntohs(lsah->length) - OSPF6_LSA_HEADER_SIZE;