Commit 6b8622a1 authored by Jonathan Currier's avatar Jonathan Currier

Harden against null pointer derefs

parent 924c7581
......@@ -61,7 +61,9 @@ int protocol_events_set(struct mbox_context *context, uint8_t bmc_event)
*/
context->bmc_events |= bmc_event;
return context->transport->ops->set_events(context->transport, bmc_event, mask);
return (context->transport) ?
context->transport->set_events(context, bmc_event, mask) :
(mbox_log(LOG_ERR, "Called %s, but transport not assigned", __func__), -1);
}
/*
......@@ -78,7 +80,9 @@ int protocol_events_clear(struct mbox_context *context, uint8_t bmc_event)
context->bmc_events &= ~bmc_event;
return context->transport->ops->clear_events(context->transport, bmc_event, mask);
return (context->transport) ?
context->transport->ops->clear_events(context->transport, bmc_event, mask) :
(mbox_log(LOG_ERR, "Called %s, but transport not assigned", __func__), -1);
}
static int protocol_negotiate_version(struct mbox_context *context,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment