From a41f59984f0c176b200432bf43b7bbe4cc2a0f1d Mon Sep 17 00:00:00 2001 From: Jon Trulson Date: Wed, 10 Jun 2015 15:00:59 -0600 Subject: [PATCH] otp538u: searching otp538u_vt_table could overflow array bounds defect #341 Signed-off-by: Jon Trulson Signed-off-by: Mihai Tudor Panu --- src/otp538u/otp538u.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/otp538u/otp538u.cxx b/src/otp538u/otp538u.cxx index 1cb69015..5b78d182 100644 --- a/src/otp538u/otp538u.cxx +++ b/src/otp538u/otp538u.cxx @@ -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[slot][voltOffset]) && (voltage < otp538u_vt_table[slot+1][voltOffset]) )