]> git.proxmox.com Git - mirror_frr.git/commit
bgpd: fix memory leak when parsing capabilities
authorQuentin Young <qlyoung@cumulusnetworks.com>
Wed, 15 Jan 2020 18:00:34 +0000 (13:00 -0500)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Thu, 16 Jan 2020 17:50:27 +0000 (12:50 -0500)
commitaba5353c175f219e5526f280d168cb0d655a0b14
tree966c316075f15edb093d4a1888c7363d378a12f5
parentc49bafc2549bf890a359cbd0e4573a77f5f00c89
bgpd: fix memory leak when parsing capabilities

Duplicated domain name capability messages cause memory leak. The amount
of leaked memory is proportional to the size of the duplicated
capabilities. This bug was introduced in 2015.

To hit this, a BGP OPEN message must contain multiple FQDN capabilities.
Memory is leaked when the hostname portion of the capability is of
length 0, but the domainname portion is not, for any of the duplicated
capabilities beyond the first one.

https://tools.ietf.org/html/draft-walton-bgp-hostname-capability-00

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
bgpd/bgp_open.c