From 046fd58e8d64c58ed80769fcbec5ac2417a04c71 Mon Sep 17 00:00:00 2001 From: Igor Biletksyy Date: Thu, 15 Sep 2022 14:54:38 -0700 Subject: [PATCH] python lib: check get_packets_versions length --- python/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/__init__.py b/python/__init__.py index a1eb30f7..984b93f2 100644 --- a/python/__init__.py +++ b/python/__init__.py @@ -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: