Skip to content

Commit

Permalink
bgpd: Don't read the first byte of ORF header if we are ahead of stream
Browse files Browse the repository at this point in the history
Reported-by: Iggy Frankovic iggyfran@amazon.com
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 9b855a6)
  • Loading branch information
ton31337 authored and mergify[bot] committed Aug 21, 2023
1 parent 3d1b6c0 commit 3515178
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bgpd/bgp_packet.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
* 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))
zlog_debug(
"%pBP rcvd Remove-All pfxlist ORF request",
Expand Down

0 comments on commit 3515178

Please sign in to comment.