From 7dcb4e89d237006447078558e59522bdcc05a2d7 Mon Sep 17 00:00:00 2001 From: Yifeng Sun Date: Wed, 13 Jul 2022 23:22:46 +0000 Subject: [PATCH] Fix a bug in ContinuationPropStack's Unmarshal function Signed-off-by: Yifeng Sun --- openflow15/nxt_message.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/openflow15/nxt_message.go b/openflow15/nxt_message.go index 7e94705..ca36bed 100644 --- a/openflow15/nxt_message.go +++ b/openflow15/nxt_message.go @@ -379,10 +379,8 @@ func (p *ContinuationPropStack) UnmarshalBinary(data []byte) error { return errors.New("the []byte is too short to unmarshal a full ContinuationPropStack message") } n += int(p.PropHeader.Len()) - for _, eachStack := range p.Stack { - data[n] = eachStack - n++ - } + p.Stack = make([]byte, int(p.Length) - n) + copy(p.Stack, data[n:]) return nil }