Skip to content

Commit 3515178

Browse files
ton31337mergify[bot]
authored andcommitted
bgpd: Don't read the first byte of ORF header if we are ahead of stream
Reported-by: Iggy Frankovic iggyfran@amazon.com Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org> (cherry picked from commit 9b855a6)
1 parent 3d1b6c0 commit 3515178

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

bgpd/bgp_packet.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2408,7 +2408,8 @@ static int bgp_route_refresh_receive(struct peer *peer, bgp_size_t size)
24082408
* and 7 bytes of ORF Address-filter entry from
24092409
* the stream
24102410
*/
2411-
if (*p_pnt & ORF_COMMON_PART_REMOVE_ALL) {
2411+
if (p_pnt < p_end &&
2412+
*p_pnt & ORF_COMMON_PART_REMOVE_ALL) {
24122413
if (bgp_debug_neighbor_events(peer))
24132414
zlog_debug(
24142415
"%pBP rcvd Remove-All pfxlist ORF request",

0 commit comments

Comments
 (0)