Handle ro_data not ending with NUL properly in extract_sw_logs.py
Signed-off-by: Alphan Ulusoy <alphan@google.com>
diff --git a/util/device_sw_utils/extract_sw_logs.py b/util/device_sw_utils/extract_sw_logs.py
index cf0d3e7..27d75c4 100755
--- a/util/device_sw_utils/extract_sw_logs.py
+++ b/util/device_sw_utils/extract_sw_logs.py
@@ -121,6 +121,10 @@
base_addr, size, data = ro_content
while (str_start < size):
str_end = data.find(b'\0', str_start)
+ # Skip the remainder of this section since it can't contain any C-strings if
+ # there are no nul bytes.
+ if str_end == -1:
+ break
# Skip if start and end is the same
if str_start == str_end:
str_start += 1