Fix ParseDataBlock of unconfirmed data

The Data slice was not initialized before calling copy(dst, src)
pull/2/head
Martin Hebnes Pedersen 6 years ago
parent 9942e7c892
commit d206b8c2bd

@ -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])
}

Loading…
Cancel
Save