Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 99f44e25 authored by Pawan Wagh's avatar Pawan Wagh
Browse files

Fix null deref in camera service

Returning exception when empty args are passed
to notifySystemEvents.

Test: m camera_service_aidl_fuzzer && adb sync data && adb shell /data/fuzz/x86_64/camera_service_aidl_fuzzer/camera_service_aidl_fuzzer
Bug: 289668975
Change-Id: I795f16dfb8b40c0a0d75762e195bd5d1123cf135
parent 3d87c778
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -2456,6 +2456,11 @@ Status CameraService::notifySystemEvent(int32_t eventId,
        }
        case ICameraService::EVENT_USB_DEVICE_ATTACHED:
        case ICameraService::EVENT_USB_DEVICE_DETACHED: {
            if (args.size() != 1) {
                return Status::fromExceptionCode(Status::EX_ILLEGAL_ARGUMENT,
                    "USB Device Event requires 1 argument");
            }

            // Notify CameraProviderManager for lazy HALs
            mCameraProviderManager->notifyUsbDeviceEvent(eventId,
                                                        std::to_string(args[0]));