From: Ondrej Zajicek Date: Thu, 24 Apr 2025 01:01:19 +0000 (+0200) Subject: BGP: Fix crash when incoming connection for disabled protocol arrives X-Git-Tag: v2.17.1~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9784c76c9;p=thirdparty%2Fbird.git BGP: Fix crash when incoming connection for disabled protocol arrives The function bgp_find_proto() may return a protocol in DOWN state, but ao.keys (as most protocol data) are only valid in non-DOWN state. --- diff --git a/proto/bgp/bgp.c b/proto/bgp/bgp.c index dcb76e05c..f762e4a62 100644 --- a/proto/bgp/bgp.c +++ b/proto/bgp/bgp.c @@ -1702,7 +1702,7 @@ bgp_incoming_connection(sock *sk, uint dummy UNUSED) return 0; } - if (!EMPTY_LIST(p->ao.keys)) + if ((p->p.proto_state != PS_DOWN) && !EMPTY_LIST(p->ao.keys)) { int current = -1, rnext = -1; sk_get_active_ao_keys(sk, ¤t, &rnext);