From bd6ff2b858804e36b3e1e42113f1ebd7d616fdd4 Mon Sep 17 00:00:00 2001 From: caochao <2930650069@qq.com> Date: Sat, 22 Jan 2022 16:24:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=BF=9B=E7=A8=8B=E8=B0=83?= =?UTF-8?q?=E7=94=A8=E6=8E=A5=E5=8F=A3=E6=97=B6=E7=9A=84=E5=88=A4=E7=A9=BA?= =?UTF-8?q?=E6=A3=80=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: cao_liu_chao --- interfaces/inner_kits/native_cpp/src/device_manager_impl.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/interfaces/inner_kits/native_cpp/src/device_manager_impl.cpp b/interfaces/inner_kits/native_cpp/src/device_manager_impl.cpp index 31107e981..87a6c77e7 100644 --- a/interfaces/inner_kits/native_cpp/src/device_manager_impl.cpp +++ b/interfaces/inner_kits/native_cpp/src/device_manager_impl.cpp @@ -70,6 +70,11 @@ bool DeviceManagerImpl::isSystemAppCalling(void) LOGI("get bundle manager proxy success."); sptr iBundleMgr = iface_cast(remoteObject); + if (iBundleMgr == nullptr) { + LOGI("iBundleMgr is nullptr, caller may be a process"); + return true; + } + return iBundleMgr->CheckIsSystemAppByUid(uid); } -- Gitee