From 1893740016d35d75de567a5f6b74db2314ffdc52 Mon Sep 17 00:00:00 2001 From: Paul Jakma Date: Thu, 27 Jul 2006 19:05:12 +0000 Subject: [bgpd] Potential bug#287 fix, peer_delete should NULL out freed buffers 2006-07-27 Paul Jakma * bgpd.c: (peer_delete) Ensure freed buffers can not be accidently reused. A potential fix for bug #287. --- bgpd/ChangeLog | 5 +++++ bgpd/bgpd.c | 7 ++++--- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'bgpd') diff --git a/bgpd/ChangeLog b/bgpd/ChangeLog index a8a6c350..90d0e0e3 100644 --- a/bgpd/ChangeLog +++ b/bgpd/ChangeLog @@ -1,3 +1,8 @@ +2006-07-27 Paul Jakma + + * bgpd.c: (peer_delete) Ensure freed buffers can not be + accidently reused. A potential fix for bug #287. + 2006-07-02 Paul Jakma * bgp_fsm.c: (bgp_{stop,start}) Move clear/free of certain diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index b574a9aa..8ed598d2 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -1205,18 +1205,19 @@ peer_delete (struct peer *peer) /* Buffers. */ if (peer->ibuf) stream_free (peer->ibuf); - if (peer->obuf) stream_fifo_free (peer->obuf); - if (peer->work) stream_free (peer->work); - + peer->obuf = NULL; + peer->work = peer->ibuf = NULL; + /* Local and remote addresses. */ if (peer->su_local) sockunion_free (peer->su_local); if (peer->su_remote) sockunion_free (peer->su_remote); + peer->su_local = peer->su_remote = NULL; bgp_sync_delete (peer); -- cgit v1.2.1