]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: Don't read the first byte of ORF header if we are ahead of stream
authorDonatas Abraitis <donatas@opensourcerouting.org>
Sun, 20 Aug 2023 19:15:27 +0000 (22:15 +0300)
committerDonatas Abraitis <donatas@opensourcerouting.org>
Sun, 20 Aug 2023 20:22:00 +0000 (23:22 +0300)
Reported-by: Iggy Frankovic iggyfran@amazon.com
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
bgpd/bgp_packet.c

index 327c6b79fd1f0c2599094e624acb4c2dcea3505e..d17781c778025876b9c7d56a768e8f02b12c3ea9 100644 (file)
@@ -2471,7 +2471,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",