From dbf3953ad47d8ab266c5e0eab42228b5664a2d09 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Sat, 9 Jan 2021 20:56:02 +0100 Subject: [PATCH] Reduce length by 1 if there is a trailing zero at the end --- squinnondation/messages.py | 1 + 1 file changed, 1 insertion(+) diff --git a/squinnondation/messages.py b/squinnondation/messages.py index 1cce4c6..bc427a5 100644 --- a/squinnondation/messages.py +++ b/squinnondation/messages.py @@ -285,6 +285,7 @@ class DataTLV(TLV): self.data = raw_data[14:len(self)] if self.data[-1] == 0: self.data = self.data[:-1] + self.length -= 1 def marshal(self) -> bytes: return self.type.to_bytes(1, sys.byteorder) + \