libril: Fix double freeing of memory in SAP
authorGohulan Balachandran <gohulanb@quicinc.com>
Fri, 20 Oct 2017 16:37:52 +0000 (09:37 -0700)
committerStricted <info@stricted.net>
Wed, 24 Oct 2018 01:49:09 +0000 (03:49 +0200)
commit60a4e9d2958b8d39892c045a6defec9eaf947f2c
tree22ef263f4b14c95f2328f0532e23307efdac1b15
parent4d60c2dbcf7c5cb6fcb61585ceba8e26b7812644
libril: Fix double freeing of memory in SAP
 service and add null-checks.

The payload of a SAP request could be freed twice in certain scenarios.
Also, add null-checks to prevent dereferencing of null pointers.

Bug: 64729356
Test: Manually run the fuzz tests and ensure that there is no crash in
      rild

Change-Id: Ib7ae269fa5297d6acea267337b220b8858c82bae
ril/libril/RilSapSocket.cpp
ril/libril/sap_service.cpp