mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 06:28:27 -04:00
Replay: fix null-pointer dereference when fields not present
This commit is contained in:
parent
9204cab7d5
commit
db833a6473
@ -104,6 +104,10 @@ template<typename R>
|
|||||||
bool MsgHandler::field_value(uint8_t *msg, const char *label, R &ret)
|
bool MsgHandler::field_value(uint8_t *msg, const char *label, R &ret)
|
||||||
{
|
{
|
||||||
struct format_field_info *info = find_field_info(label);
|
struct format_field_info *info = find_field_info(label);
|
||||||
|
if (info == NULL) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
uint8_t offset = info->offset;
|
uint8_t offset = info->offset;
|
||||||
if (offset == 0) {
|
if (offset == 0) {
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user