diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-09-09 01:17:06 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-09-09 01:17:06 +0000 |
commit | a46c03ee1f133777b2ff06e627579cdf487148ca (patch) | |
tree | b028a70b9c4863655352f0032a44f2adb2c78dad | |
parent | 9f9847ac3f48a05ea06bb9237526fa4a2c354468 (diff) | |
parent | 9e70aaf0e193493d144760ff14cff852d980f311 (diff) | |
download | pixel-a46c03ee1f133777b2ff06e627579cdf487148ca.tar.gz |
Snap for 10783763 from 9e70aaf0e193493d144760ff14cff852d980f311 to udc-qpr1-release
Change-Id: I85e77036240fe7086516685b9b3c204d61cfb9c8
-rw-r--r-- | thermal/utils/thermal_files.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/thermal/utils/thermal_files.cpp b/thermal/utils/thermal_files.cpp index 26aaf450..c42fa1c3 100644 --- a/thermal/utils/thermal_files.cpp +++ b/thermal/utils/thermal_files.cpp @@ -63,6 +63,11 @@ bool ThermalFiles::readThermalFile(std::string_view thermal_name, std::string *d return false; } + if (sensor_reading.size() <= 1) { + LOG(ERROR) << thermal_name << "'s return size:" << sensor_reading.size() << " is invalid"; + return false; + } + // Strip the newline. *data = ::android::base::Trim(sensor_reading); return true; |