Merge pull request #12891 from FRRouting/mergify/bp/dev/8.5/pr-12884

bgpd: Flowspec overflow issue (backport #12884)
This commit is contained in:
Donatas Abraitis 2023-02-24 15:42:10 +02:00 committed by GitHub
commit 9a72aeeb04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -140,6 +140,13 @@ int bgp_nlri_parse_flowspec(struct peer *peer, struct attr *attr,
psize); psize);
return BGP_NLRI_PARSE_ERROR_PACKET_OVERFLOW; 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) { if (bgp_fs_nlri_validate(pnt, psize, afi) < 0) {
flog_err( flog_err(
EC_BGP_FLOWSPEC_PACKET, EC_BGP_FLOWSPEC_PACKET,