From 75af1b38d114f133f8671b39e4bebee3eb4c01d0 Mon Sep 17 00:00:00 2001 From: luzhiye Date: Tue, 11 Feb 2025 17:15:12 +0800 Subject: [PATCH] =?UTF-8?q?AI=20Review=E5=91=8A=E8=AD=A6=E6=95=B4=E6=94=B9?= =?UTF-8?q?-=E7=A9=BA=E6=8C=87=E9=92=88=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: luzhiye --- services/native/src/usb_service.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/native/src/usb_service.cpp b/services/native/src/usb_service.cpp index aa0fffb1..1891e26f 100644 --- a/services/native/src/usb_service.cpp +++ b/services/native/src/usb_service.cpp @@ -1844,6 +1844,10 @@ bool UsbService::GetCallingInfo(std::string &bundleName, std::string &tokenId, i int32_t UsbService::CheckSysApiPermission() { + if (usbRightManager_ == nullptr) { + USB_HILOGE(MODULE_USB_SERVICE, "invalid usbRightManager_"); + return UEC_SERVICE_INVALID_VALUE; + } if (!usbRightManager_->IsSystemAppOrSa()) { return UEC_SERVICE_PERMISSION_DENIED_SYSAPI; } -- Gitee