Skip to content

Commit

Permalink
Merge pull request #12895 from FRRouting/mergify/bp/stable/8.1/pr-12884
Browse files Browse the repository at this point in the history
bgpd: Flowspec overflow issue (backport #12884)
  • Loading branch information
donaldsharp committed Feb 24, 2023
2 parents 0810529 + 2fa384a commit 6dc2942
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions bgpd/bgp_flowspec.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,13 @@ int bgp_nlri_parse_flowspec(struct peer *peer, struct attr *attr,
psize);
return BGP_NLRI_PARSE_ERROR_PACKET_OVERFLOW;
}

if (psize == 0) {
flog_err(EC_BGP_FLOWSPEC_PACKET,
"Flowspec NLRI length 0 which makes no sense");
return BGP_NLRI_PARSE_ERROR_PACKET_OVERFLOW;
}

if (bgp_fs_nlri_validate(pnt, psize, afi) < 0) {
flog_err(
EC_BGP_FLOWSPEC_PACKET,
Expand Down

0 comments on commit 6dc2942

Please sign in to comment.