]> 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)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Sun, 5 May 2024 16:35:59 +0000 (16:35 +0000)
Reported-by: Iggy Frankovic iggyfran@amazon.com
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 9b855a692e68e0d16467e190b466b4ecb6853702)

bgpd/bgp_packet.c

index ec54943f3b4bffadf682e977696de2eeaddaae11..efca9b7a514390d82a8078e8a9ec52cc5fb9331b 100644 (file)
@@ -2375,7 +2375,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",