Skip to content

Commit

Permalink
Merge pull request FRRouting#16865 from FRRouting/mergify/bp/stable/9…
Browse files Browse the repository at this point in the history
….0/pr-16860

ospfd: Fix heap corruption vulnerability when parsing SR-Algorithm TLV (backport FRRouting#16860)
  • Loading branch information
donaldsharp committed Sep 19, 2024
2 parents c9d5af7 + ebd8d3e commit 4eddddb
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 4eddddb

Please sign in to comment.