OSDN Git Service

Fix Sap Service
authorsqian <shuoq@google.com>
Tue, 5 Sep 2017 18:51:45 +0000 (11:51 -0700)
committersqian <shuoq@google.com>
Tue, 5 Sep 2017 22:30:54 +0000 (15:30 -0700)
Because sapDecodeMessage can return NULL in its code logic, to check NULL
before its usage in processResponse might be necessary.

Bug: 65028505
Test: fuzzer
Change-Id: I27ee6ef99c495e29408c3c0d895cb8ee54d54173

libril/sap_service.cpp

index b9c7e58..ee04afb 100644 (file)
@@ -775,6 +775,13 @@ void processResponse(MsgHeader *rsp, RilSapSocket *sapSocket, MsgType msgType) {
         return;
     }
 
+    if (messagePtr == NULL) {
+        RLOGE("processResponse: *messagePtr == NULL; msgId = %d; msgType = %d",
+                msgId, msgType);
+        sapImpl->sendFailedResponse(msgId, rsp->token, 0);
+        return;
+    }
+
     RLOGD("processResponse: sapCallback != NULL; msgId = %d; msgType = %d",
             msgId, msgType);