Replay: fix null-pointer dereference when fields not present

This commit is contained in:
Peter Barker 2015-04-30 16:55:41 +10:00
parent 9204cab7d5
commit db833a6473

View File

@ -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;