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

Commit de8d64a8 authored by Stan Rokita's avatar Stan Rokita Committed by Android (Google) Code Review
Browse files

Merge "Fix null pointer deref in libsensor SensorServer"

parents 304d161f 2249c88e
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -199,6 +199,10 @@ status_t BnSensorServer::onTransact(
            int32_t type = data.readInt32();
            int32_t format = data.readInt32();
            native_handle_t *resource = data.readNativeHandle();
            // Avoid a crash in native_handle_close if resource is nullptr
            if (resource == nullptr) {
                return BAD_VALUE;
            }
            sp<ISensorEventConnection> ch =
                    createSensorDirectConnection(opPackageName, size, type, format, resource);
            native_handle_close(resource);