From b8717cc469178f3e27cf97be690d0ebb076e283c Mon Sep 17 00:00:00 2001 From: jvcilang Date: Tue, 6 Jul 2021 13:22:40 +0000 Subject: [PATCH] modify codex malixian@huawei.com Signed-off-by: jvcilang --- frameworks/src/sensor_agent_proxy.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frameworks/src/sensor_agent_proxy.c b/frameworks/src/sensor_agent_proxy.c index c14a04d..ed6863b 100755 --- a/frameworks/src/sensor_agent_proxy.c +++ b/frameworks/src/sensor_agent_proxy.c @@ -167,6 +167,10 @@ int32_t Notify(IOwner owner, int32_t code, IpcIo *reply) return GetSensorInfos(owner, reply); } int32_t *ret = (int32_t *)owner; + if (ret == NULL) { + HILOG_ERROR(HILOG_MODULE_APP, "%s failed, sensorEvent is NULL", __func__); + return SENSOR_ERROR_INVALID_PARAM; + } if ((functionId > SENSOR_SERVICE_ID_GetAllSensors) && (functionId < SENSORMGR_LISTENER_NAME_LEN)) { *ret = IpcIoPopInt32(reply); HILOG_DEBUG(HILOG_MODULE_APP, "%s ret: %d", __func__, *ret); -- Gitee