From ffe6ac716167f53f17bfc38480226bd1cb503911 Mon Sep 17 00:00:00 2001 From: Anton Zadvorny Date: Sat, 10 Jul 2021 11:50:31 +0300 Subject: [PATCH] Fix datagram parsing --- datagram.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datagram.go b/datagram.go index 7277065..3417eba 100644 --- a/datagram.go +++ b/datagram.go @@ -30,7 +30,7 @@ func NewDatagramFrom(r io.Reader) (*Datagram, error) { return nil, err } - if !bytes.Equal([]byte{Reserved, Reserved}, buf[:1]) { + if !bytes.Equal([]byte{Reserved, Reserved}, buf[:2]) { return nil, ErrBadDatagram }