]> 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>
Mon, 21 Aug 2023 13:33:26 +0000 (13:33 +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 bd17a2eec84ecb145f392d54fc5865a6427dadc0..c852203e5b661ab6d097c209a6ac25ab8eb4bbca 100644 (file)
@@ -2401,7 +2401,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",