Android-x86
Fork
Donation

  • R/O
  • HTTP
  • SSH
  • HTTPS

hardware-libsensors: 提交

hardware/libsensors


Commit MetaInfo

修订版168c15b9a7e045eeaa24a9dcfd61ee9ec364410d (tree)
时间2019-07-02 12:55:43
作者Chih-Wei Huang <cwhuang@linu...>
CommiterChih-Wei Huang

Log Message

kbdsensor: fix uninitialized error

Initialize the struct sensors_poll_device_1 to zero, otherwise some
members may have unexpected value which causes crashing.

更改概述

差异

--- a/kbdsensor.cpp
+++ b/kbdsensor.cpp
@@ -48,6 +48,7 @@ template <typename T> struct SensorFd : T {
4848
4949 template <typename T> SensorFd<T>::SensorFd(const struct hw_module_t *module)
5050 {
51+ memset(this, 0, sizeof(*this));
5152 this->common.tag = HARDWARE_DEVICE_TAG;
5253 this->common.version = SENSORS_DEVICE_API_VERSION_1_3;
5354 this->common.module = const_cast<struct hw_module_t *>(module);
Show on old repository browser