Add magic value

This commit is contained in:
jpirnay
2026-03-08 16:26:52 +01:00
parent a3a50c8c40
commit ed1a21fb7b
2 changed files with 21 additions and 9 deletions
+4 -4
View File
@@ -57,10 +57,10 @@ void logPrintf(const char* level, const char* origin, const char* format, ...);
std::string getLastLogs();
void clearLastLogs();
// Clamps logHead into range. Returns true if logHead was out of range (repaired),
// which also means logMessages is untrusted garbage. Callers should call
// clearLastLogs() when this returns true so getLastLogs() does not dump corrupt
// data into crash reports.
// Validates the RTC log state (magic word + logHead range). Returns true if
// corruption was detected (magic mismatch or logHead out of range), meaning
// logMessages is untrusted garbage. Callers should call clearLastLogs() when
// this returns true so getLastLogs() does not dump corrupt data into crash reports.
bool sanitizeLogHead();
class MySerialImpl : public Print {