From 21b31827e5fe0d778f2d65166950721237a7b7ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B1=E6=98=AF=E9=93=B8=E5=B8=81=E6=8D=8F?= Date: Fri, 25 Apr 2025 18:54:55 +0800 Subject: [PATCH] fix fuzz test Signed-off-by:echos2019 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 就是铸币捏 --- frameworks/native/src/sensor_agent_proxy.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frameworks/native/src/sensor_agent_proxy.cpp b/frameworks/native/src/sensor_agent_proxy.cpp index dfb11bc2..a1cc1fbd 100644 --- a/frameworks/native/src/sensor_agent_proxy.cpp +++ b/frameworks/native/src/sensor_agent_proxy.cpp @@ -438,6 +438,10 @@ int32_t SensorAgentProxy::GetAllSensors(SensorInfo **sensorInfo, int32_t *count) CHKPR(sensorInfo, OHOS::Sensors::ERROR); CHKPR(count, OHOS::Sensors::ERROR); std::lock_guard listLock(sensorInfoMutex_); + if ((*sensorInfo) == nullptr) { + SEN_HILOGE("sensorInfo pointer is null"); + return ERROR; + } int32_t ret = ConvertSensorInfos(); if (ret != SUCCESS) { SEN_HILOGE("Convert sensor lists failed"); -- Gitee