From 540d77319c6eaa1eefd7b52df2a4771c7ee565ac Mon Sep 17 00:00:00 2001 From: Wataru Ishida Date: Fri, 5 May 2017 09:17:50 -0400 Subject: mrt: fix bug of general address family rib serialization allocate a slice with 2 byte length (not 2 byte capacity) for PutUint16() fixes #1313 Signed-off-by: Wataru Ishida --- packet/mrt/mrt.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packet/mrt/mrt.go') diff --git a/packet/mrt/mrt.go b/packet/mrt/mrt.go index 041a2802..8947648a 100644 --- a/packet/mrt/mrt.go +++ b/packet/mrt/mrt.go @@ -465,7 +465,7 @@ func (u *Rib) Serialize() ([]byte, error) { switch rf { case bgp.RF_IPv4_UC, bgp.RF_IPv4_MC, bgp.RF_IPv6_UC, bgp.RF_IPv6_MC: default: - bbuf := make([]byte, 0, 2) + bbuf := make([]byte, 2) binary.BigEndian.PutUint16(bbuf, u.Prefix.AFI()) buf = append(buf, bbuf...) buf = append(buf, u.Prefix.SAFI()) -- cgit v1.2.3