AP_Logger: make structure validation failure at runtime fatal

This commit is contained in:
Peter Barker 2019-03-25 17:26:24 +11:00 committed by Andrew Tridgell
parent eb1fc3107c
commit bd8a27476e
1 changed files with 4 additions and 1 deletions

View File

@ -871,7 +871,10 @@ AP_Logger::log_write_fmt *AP_Logger::msg_fmt_for_name(const char *name, const ch
} else {
memset((char*)ls_multipliers, '?', MIN(sizeof(ls_format), strlen(f->fmt)));
}
validate_structure(&ls, (int16_t)-1);
if (!validate_structure(&ls, (int16_t)-1)) {
Debug("Log structure invalid");
abort();
}
#endif
return f;