mirror of
https://github.com/espressif/esptool.git
synced 2025-10-16 23:06:31 +08:00
fix: Add timeout to read_flash to avoid infinite loops
This should handle cases when e.g. reading more then flash size
This commit is contained in:
@@ -1359,6 +1359,7 @@ class ESPLoader(object):
|
||||
# now we expect (length // block_size) SLIP frames with the data
|
||||
data = b""
|
||||
while len(data) < length:
|
||||
self._port.timeout = 3
|
||||
p = self.read()
|
||||
data += p
|
||||
data_len = len(data)
|
||||
|
Reference in New Issue
Block a user