Skip to content

Commit

Permalink
Merge pull request #16860 from LabNConsulting/aceelindem/ospf-sr-algo…
Browse files Browse the repository at this point in the history
…-vulnerability

ospfd: Fix heap corruption vulnerability when parsing SR-Algorithm TLV
  • Loading branch information
Jafaral committed Sep 18, 2024
2 parents f075792 + 0dc9691 commit 9a009e1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ospfd/ospf_sr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1459,7 +1459,8 @@ void ospf_sr_ri_lsa_update(struct ospf_lsa *lsa)
/* Update Algorithm, SRLB and MSD if present */
if (algo != NULL) {
int i;
for (i = 0; i < ntohs(algo->header.length); i++)
for (i = 0;
i < ntohs(algo->header.length) && i < ALGORITHM_COUNT; i++)
srn->algo[i] = algo->value[0];
for (; i < ALGORITHM_COUNT; i++)
srn->algo[i] = SR_ALGORITHM_UNSET;
Expand Down

0 comments on commit 9a009e1

Please sign in to comment.