commit | ce6e742eb6a08bb072af51bd5be7b8d6844713ed | [log] [tgz] |
---|---|---|
author | Peng Xu <pengxu@google.com> | Thu May 04 17:14:42 2017 -0700 |
committer | Peng Xu <pengxu@google.com> | Tue Sep 19 12:16:26 2017 -0700 |
tree | 48191a3e7755bd99df0ac734ef4b75d80de23dea | |
parent | 44256a7fbd594387394d841e97c9d28f33e10c18 [diff] |
Only convert valid SharedMemInfo This CL avoids passing nullptr to underlying HAL and cause SEGFAULT. Bug: 37589989 Test: compiles and VTS passing Change-Id: Ic44409e64466e54a3a3027721897c0755ba34fc7 Merged-In: Ic44409e64466e54a3a3027721897c0755ba34fc7
diff --git a/sensors/1.0/default/convert.cpp b/sensors/1.0/default/convert.cpp index 047374f..a5747d4 100644 --- a/sensors/1.0/default/convert.cpp +++ b/sensors/1.0/default/convert.cpp
@@ -376,6 +376,10 @@ return false; } + if (memIn.memoryHandle == nullptr) { + return false; + } + memOut->size = memIn.size; memOut->handle = memIn.memoryHandle; return true;