stc8: check length of status packet
Fixes a fuzzing error.
This commit is contained in:
parent
11d2ea22e6
commit
ce251f9d30
@ -1569,6 +1569,9 @@ class Stc8Protocol(Stc15Protocol):
|
||||
def initialize_status(self, packet):
|
||||
"""Decode status packet and store basic MCU info"""
|
||||
|
||||
if len(packet) < 39:
|
||||
raise StcProtocolException("invalid status packet")
|
||||
|
||||
self.mcu_clock_hz, = struct.unpack(">I", packet[1:5])
|
||||
self.external_clock = False
|
||||
# all ones means no calibration
|
||||
|
Loading…
Reference in New Issue
Block a user