diff --git a/bgpd/bgp_packet.c b/bgpd/bgp_packet.c index ca211589f7..0800dd74ba 100644 --- a/bgpd/bgp_packet.c +++ b/bgpd/bgp_packet.c @@ -603,8 +603,6 @@ bgp_notify_send_with_data (struct peer *peer, u_char code, u_char sub_code, struct stream *s; int length; - assert (data); - /* Allocate new stream. */ s = stream_new (BGP_MAX_PACKET_SIZE); @@ -616,7 +614,8 @@ bgp_notify_send_with_data (struct peer *peer, u_char code, u_char sub_code, stream_putc (s, sub_code); /* BGP notify sub_code */ /* If notify data is present. */ - stream_write (s, data, datalen); + if (data) + stream_write (s, data, datalen); /* Set BGP packet length. */ length = bgp_packet_set_size (s);