mirror of
https://github.com/eclipse/upm.git
synced 2025-03-15 04:57:30 +03:00
otp538u: searching otp538u_vt_table could overflow array bounds
defect #341 Signed-off-by: Jon Trulson <jtrulson@ics.com> Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:
parent
0bab36a95a
commit
a41f59984f
@ -163,7 +163,7 @@ float OTP538U::objectTemperature()
|
||||
// add +2 to compensate for the -20C and -10C slots below zero
|
||||
int voltOffset = int(ambTemp / 10) + 1 + 2;
|
||||
float voltage = sensorVolts * 10.0;
|
||||
for (slot=0; slot<otp538u_vt_table_max; slot++)
|
||||
for (slot=0; slot<(otp538u_vt_table_max - 1); slot++)
|
||||
{
|
||||
if ( (voltage > otp538u_vt_table[slot][voltOffset]) &&
|
||||
(voltage < otp538u_vt_table[slot+1][voltOffset]) )
|
||||
|
Loading…
x
Reference in New Issue
Block a user