summaryrefslogtreecommitdiff
path: root/utils/MsgTask.cpp
diff options
context:
space:
mode:
authorKevin Tang <zhikait@codeaurora.org>2017-01-09 18:53:54 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2017-03-15 19:23:41 -0700
commit5253a74c6b3efb7456c4422aec4b5af55ddc8807 (patch)
tree55c0d5b6324b36b49e1209654004962ab354f8ae /utils/MsgTask.cpp
parent681388fa8dd3f1ff9c8b788ac20e90a16fd5b62d (diff)
possible NULL pointer dereference
it appears some of the MsgTask msgs might fail to create, ending up with a NULL pointer, in which case when it gets received, dereferencing a NULL pointer will happen, causing crash. Change-Id: I5a4295b4fba9c8383754e2abe6558782b1b83143 CRs-Fixed: 1106034
Diffstat (limited to 'utils/MsgTask.cpp')
-rw-r--r--utils/MsgTask.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/utils/MsgTask.cpp b/utils/MsgTask.cpp
index 2163511..84f38c8 100644
--- a/utils/MsgTask.cpp
+++ b/utils/MsgTask.cpp
@@ -73,7 +73,11 @@ void MsgTask::destroy() {
}
void MsgTask::sendMsg(const LocMsg* msg) const {
- msg_q_snd((void*)mQ, (void*)msg, LocMsgDestroy);
+ if (msg) {
+ msg_q_snd((void*)mQ, (void*)msg, LocMsgDestroy);
+ } else {
+ LOC_LOGE("%s: msg is NULL", __func__);
+ }
}
void MsgTask::prerun() {