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

Commit 6f6d98bb authored by Yifan Hong's avatar Yifan Hong Committed by android-build-merger
Browse files

android.frameworks.sensorservice@1.0: ashmem direct channel check sizes.

am: 8a420ed6

Change-Id: I95c0352822944f1859896a5aaccebd88518e4437
parents 4501ae23 8a420ed6
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ namespace V1_0 {
namespace implementation {

using ::android::hardware::sensors::V1_0::SensorInfo;
using ::android::hardware::sensors::V1_0::SensorsEventFormatOffset;
using ::android::hardware::hidl_vec;
using ::android::hardware::Void;
using ::android::sp;
@@ -102,7 +103,7 @@ void createDirectChannel(::android::SensorManager& manager, size_t size, int typ
Return<void> SensorManager::createAshmemDirectChannel(
        const hidl_memory& mem, uint64_t size,
        createAshmemDirectChannel_cb _hidl_cb) {
    if (size > mem.size()) {
    if (size > mem.size() || size < (uint64_t)SensorsEventFormatOffset::TOTAL_LENGTH) {
        _hidl_cb(nullptr, Result::BAD_VALUE);
        return Void();
    }