sensorhandler: Fix uninitialized reads
The response struct in GetSensorThresholdsResponse was not initialized
and has arbitrary data leftover from the stack. Some values like upper
and lower non-recoverable never get initialized and end up with
garbage data being reported.
Change-Id: I766f8daeb60c1ebc987cff6a24f8d8d78d64ffdd
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/sensorhandler.cpp b/sensorhandler.cpp
index e23ea48..775f651 100644
--- a/sensorhandler.cpp
+++ b/sensorhandler.cpp
@@ -474,7 +474,7 @@
get_sdr::GetSensorThresholdsResponse getSensorThresholds(uint8_t sensorNum)
{
- get_sdr::GetSensorThresholdsResponse resp;
+ get_sdr::GetSensorThresholdsResponse resp{};
constexpr auto warningThreshIntf =
"xyz.openbmc_project.Sensor.Threshold.Warning";
constexpr auto criticalThreshIntf =