diff options
Diffstat (limited to 'pkg/packet/bgp/prefix_sid.go')
-rw-r--r-- | pkg/packet/bgp/prefix_sid.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/packet/bgp/prefix_sid.go b/pkg/packet/bgp/prefix_sid.go index a7983bcd..32f575ee 100644 --- a/pkg/packet/bgp/prefix_sid.go +++ b/pkg/packet/bgp/prefix_sid.go @@ -52,7 +52,7 @@ func (s *TLV) DecodeFromBytes(data []byte) ([]byte, error) { p++ s.Length = binary.BigEndian.Uint16(data[p : p+2]) - if len(data) < s.Len() { + if s.Len() < prefixSIDtlvHdrLen || len(data) < s.Len() { return nil, malformedAttrListErr("decoding failed: Prefix SID TLV malformed") } |