OSDN Git Service

Check handle for nullptr
authorSteven Moreland <smoreland@google.com>
Tue, 23 May 2017 23:06:04 +0000 (16:06 -0700)
committerSteven Moreland <smoreland@google.com>
Tue, 23 May 2017 23:12:34 +0000 (16:12 -0700)
Test: pass
Bug: 37662706
Change-Id: Ia3ec4d8e512d18b679a9d6291a8dfdc0eb0cceec

dumpstate/1.0/default/DumpstateDevice.cpp

index 213fc62..818a531 100644 (file)
@@ -37,7 +37,7 @@ Return<void> DumpstateDevice::dumpstateBoard(const hidl_handle& handle) {
     // this interface - since HIDL_FETCH_IDumpstateDevice() is not defined, this function will never
     // be called by dumpstate.
 
-    if (handle->numFds < 1) {
+    if (handle == nullptr || handle->numFds < 1) {
         ALOGE("no FDs\n");
         return Void();
     }