python lib: check get_packets_versions length

This commit is contained in:
Igor Biletksyy
2022-09-15 14:54:38 -07:00
parent f029c99440
commit 046fd58e8d

View File

@@ -540,7 +540,7 @@ class Panda:
# Returns tuple with health packet version and CAN packet/USB packet version
def get_packets_versions(self):
dat = self._handle.controlRead(Panda.REQUEST_IN, 0xdd, 0, 0, 3)
if dat:
if dat and len(dat) == 3:
a = struct.unpack("BBB", dat)
return (a[0], a[1], a[2])
else: