Clear log if invalid
This commit is contained in:
@@ -79,7 +79,11 @@ void begin() {
|
||||
} else {
|
||||
// Panic reboot: preserve logs and panic info, but clamp logHead in case the
|
||||
// panic occurred before begin() ever ran (e.g. in a static constructor).
|
||||
sanitizeLogHead();
|
||||
// If logHead was out of range, logMessages is also garbage — clear it so
|
||||
// getLastLogs() does not dump corrupt data into the crash report.
|
||||
if (sanitizeLogHead()) {
|
||||
clearLastLogs();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user