diff --git a/src/trezor/wire/wire_codec.py b/src/trezor/wire/wire_codec.py index 22a2669a8b..9b2d4ec35e 100644 --- a/src/trezor/wire/wire_codec.py +++ b/src/trezor/wire/wire_codec.py @@ -115,7 +115,10 @@ Pass report payloads as `memoryview` for cheaper slicing. msg_footer = data_tail[:_MSG_FOOTER_LEN] if len(msg_footer) < _MSG_FOOTER_LEN: data_tail = yield # read report with the rest of checksum - msg_footer += data_tail[:_MSG_FOOTER_LEN - len(msg_footer)] + footer_tail = data_tail[:_MSG_FOOTER_LEN - len(msg_footer)] + if isinstance(msg_footer, memoryview): + msg_footer = bytearray(msg_footer) + msg_footer.extend(footer_tail) data_checksum, = parse_message_footer(msg_footer) if data_checksum != checksum: