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 9b855a692e)
This commit is contained in:
Donatas Abraitis 2023-08-20 22:15:27 +03:00 committed by Mergify
parent 3d1b6c0e60
commit 3515178de4

View File

@ -2408,7 +2408,8 @@ static int bgp_route_refresh_receive(struct peer *peer, bgp_size_t size)
* and 7 bytes of ORF Address-filter entry from * and 7 bytes of ORF Address-filter entry from
* the stream * the stream
*/ */
if (*p_pnt & ORF_COMMON_PART_REMOVE_ALL) { if (p_pnt < p_end &&
*p_pnt & ORF_COMMON_PART_REMOVE_ALL) {
if (bgp_debug_neighbor_events(peer)) if (bgp_debug_neighbor_events(peer))
zlog_debug( zlog_debug(
"%pBP rcvd Remove-All pfxlist ORF request", "%pBP rcvd Remove-All pfxlist ORF request",