ecu addrs: check msg length (#27956)

check length
pull/27959/head
Shane Smiskol 2 years ago committed by GitHub
parent 5aebdb0ad0
commit 3924c14b74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      selfdrive/car/ecu_addrs.py

@ -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:

Loading…
Cancel
Save