Use assert to ensure Message *m is not NULL.
Fix for:
CID
1399578 (#4 of 4): Dereference after null check (FORWARD_NULL)
var_deref_model: Passing null pointer m to submit_message,
which dereferences it.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
int AsyncMessenger::_send_message(Message *m, const entity_inst_t& dest)
{
FUNCTRACE();
- if (m && m->get_type() == CEPH_MSG_OSD_OP)
+ assert(m);
+
+ if (m->get_type() == CEPH_MSG_OSD_OP)
OID_EVENT_TRACE(((MOSDOp *)m)->get_oid().name.c_str(), "SEND_MSG_OSD_OP");
- else if (m && m->get_type() == CEPH_MSG_OSD_OPREPLY)
+ else if (m->get_type() == CEPH_MSG_OSD_OPREPLY)
OID_EVENT_TRACE(((MOSDOpReply *)m)->get_oid().name.c_str(), "SEND_MSG_OSD_OP_REPLY");
ldout(cct, 1) << __func__ << "--> " << dest.name << " "