From 15f0c50a61711c46357d369bbef60016ced7bbb2 Mon Sep 17 00:00:00 2001 From: Eiichiro Watanabe Date: Thu, 21 Mar 2019 15:57:49 +0900 Subject: pkg/packet/bgp: avoid crash when receiving an update with invalid AS_PATH len --- pkg/packet/bgp/bgp.go | 1 + 1 file changed, 1 insertion(+) (limited to 'pkg') diff --git a/pkg/packet/bgp/bgp.go b/pkg/packet/bgp/bgp.go index c66d4a70..9a1af06b 100644 --- a/pkg/packet/bgp/bgp.go +++ b/pkg/packet/bgp/bgp.go @@ -12318,6 +12318,7 @@ func (msg *BGPUpdate) DecodeFromBytes(data []byte, options ...*MarshallingOption if e.(*MessageError).Stronger(strongestError) { strongestError = e } + return strongestError } data = data[p.Len(options...):] if e == nil || e.(*MessageError).ErrorHandling != ERROR_HANDLING_ATTRIBUTE_DISCARD { -- cgit v1.2.3