From d206b8c2bd313bf479131851c90651c4b356dc85 Mon Sep 17 00:00:00 2001 From: Martin Hebnes Pedersen Date: Mon, 1 Apr 2019 21:53:37 +0200 Subject: [PATCH] Fix ParseDataBlock of unconfirmed data The Data slice was not initialized before calling copy(dst, src) --- data.go | 1 + 1 file changed, 1 insertion(+) diff --git a/data.go b/data.go index f2cc79b..2f3eacb 100644 --- a/data.go +++ b/data.go @@ -54,6 +54,7 @@ func ParseDataBlock(data []byte, dataType uint8, confirmed bool) (*DataBlock, er return nil, fmt.Errorf("dmr: block CRC error (%#04x != %#04x)", crc, db.CRC) } } else { + db.Data = make([]byte, db.Length) copy(db.Data, data[:db.Length]) }