Commit 14c78064 authored by Iulian Gheorghiu's avatar Iulian Gheorghiu

Fix a buffer overflow error

parent d48246a2
......@@ -509,7 +509,7 @@ SysErr GI::Device::Sensor::Mpu60x0_9x50::testAccel(double *XtestResult, double *
if((err = getAccelData(&_Xdata, &_Ydata, &_Zdata)))
return err;
unsigned char reg = MPU60X0_9150_SELF_TEST_X;
unsigned char result[3];
unsigned char result[4];
if(I2C->writeRead(MPU60x0_9150_ADDR | (IcNr & 0x01), &reg, 1, result, 4))
return SYS_ERR_BUS;
double XA_TEST = (double)(((result[0] >> 4) & 0x0C) | ((result[3] >> 4) & 0x03));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment