]> git.puffer.fish Git - mirror/frr.git/commitdiff
ospfd: catch and report runt LSAs 12228/head
authorLou Berger <lberger@labn.net>
Fri, 28 Oct 2022 16:06:04 +0000 (16:06 +0000)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Sat, 29 Oct 2022 21:59:33 +0000 (21:59 +0000)
Signed-off-by: Lou Berger <lberger@labn.net>
(cherry picked from commit 53674eaba6a34f42f322f79449c2ab667884fb82)

ospfd/ospf_packet.c

index 466b5fa2a27cd062553eda548682465950b738d9..8c87a568c0bc38d23737447316325ed6803b8596 100644 (file)
@@ -1716,6 +1716,12 @@ static struct list *ospf_ls_upd_list_lsa(struct ospf_neighbor *nbr,
                        break;
                }
 
+               if (length < OSPF_LSA_HEADER_SIZE) {
+                       flog_warn(EC_OSPF_PACKET,
+                                 "Link State Update: LSA length too small.");
+                       break;
+               }
+
                /* Validate the LSA's LS checksum. */
                sum = lsah->checksum;
                if (!ospf_lsa_checksum_valid(lsah)) {