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

Commit 8dd4fe8d authored by Mathias Agopian's avatar Mathias Agopian
Browse files

fix a potential buffer overflow in sensorservice

Bug: 6580560
Change-Id: Icf6cafbca09174515a964a7cd69d8cc589ad52de
parent d1920ffe
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -226,7 +226,7 @@ bool SensorService::threadLoop()
    ALOGD("nuSensorService thread starting...");

    const size_t numEventMax = 16;
    const size_t minBufferSize = numEventMax * mVirtualSensorList.size();
    const size_t minBufferSize = numEventMax + numEventMax * mVirtualSensorList.size();
    sensors_event_t buffer[minBufferSize];
    sensors_event_t scratch[minBufferSize];
    SensorDevice& device(SensorDevice::getInstance());