ecu addrs: check msg length (#27956)

check length
old-commit-hash: 3924c14b74331368fa0193514da5bcf5eb2b2837
This commit is contained in:
Shane Smiskol
2023-04-18 13:15:54 -07:00
committed by GitHub
parent d916e0ed2d
commit 72453b6040
+3
View File
@@ -55,6 +55,9 @@ def get_ecu_addrs(logcan: messaging.SubSocket, sendcan: messaging.PubSocket, que
can_packets = messaging.drain_sock(logcan, wait_for_one=True)
for packet in can_packets:
for msg in packet.can:
if not len(msg.dat):
continue
subaddr = None if (msg.address, None, msg.src) in responses else msg.dat[0]
if (msg.address, subaddr, msg.src) in responses and is_tester_present_response(msg, subaddr):
if debug: