summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2012-05-30 18:08:30 -0700
committerMathias Agopian <mathias@google.com>2012-06-27 17:07:56 -0700
commit8dd4fe8dd37b740282b48b7867eec26fcf95e027 (patch)
treeec018c444380be8bebd3bf9f4b08fe026c1ae734
parentd1920ffede9e9bc107104ad94c291ca0f0f18bc3 (diff)
downloadframeworks_native-8dd4fe8dd37b740282b48b7867eec26fcf95e027.zip
frameworks_native-8dd4fe8dd37b740282b48b7867eec26fcf95e027.tar.gz
frameworks_native-8dd4fe8dd37b740282b48b7867eec26fcf95e027.tar.bz2
fix a potential buffer overflow in sensorservice
Bug: 6580560 Change-Id: Icf6cafbca09174515a964a7cd69d8cc589ad52de
-rw-r--r--services/sensorservice/SensorService.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/services/sensorservice/SensorService.cpp b/services/sensorservice/SensorService.cpp
index 04ec820..9e5e84b 100644
--- a/services/sensorservice/SensorService.cpp
+++ b/services/sensorservice/SensorService.cpp
@@ -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());