Skip to content

Commit

Permalink
Merge pull request FRRouting#16862 from FRRouting/mergify/bp/stable/1…
Browse files Browse the repository at this point in the history
…0.1/pr-16860

ospfd: Fix heap corruption vulnerability when parsing SR-Algorithm TLV (backport FRRouting#16860)
  • Loading branch information
Jafaral committed Sep 19, 2024
2 parents a099561 + 9da0298 commit a4c96c6
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 a4c96c6

Please sign in to comment.