Skip to content

Commit 27003c5

Browse files
authored
Merge pull request FRRouting#19909 from mjstapp/bgp_parse_fspec
bgpd: check more during flowspec nlri parsing
2 parents c0c8780 + 8e27c09 commit 27003c5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

bgpd/bgp_flowspec.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,10 @@ int bgp_nlri_parse_flowspec(struct peer *peer, struct attr *attr,
114114

115115
psize = *pnt++;
116116
if (psize >= FLOWSPEC_NLRI_SIZELIMIT) {
117+
/* We're going to look at next octet */
118+
if (pnt + 1 > lim)
119+
return BGP_NLRI_PARSE_ERROR_PACKET_OVERFLOW;
120+
117121
psize &= 0x0f;
118122
psize = psize << 8;
119123
psize |= *pnt++;

0 commit comments

Comments
 (0)