diff options
author | D. Andrei Măceș <dmaces@nd.edu> | 2017-10-07 18:07:00 +0300 |
---|---|---|
committer | Bruno Martins <bgcngm@gmail.com> | 2018-08-30 10:19:25 +0200 |
commit | 47a94aacc60560363ea948835862613a6327b5f8 (patch) | |
tree | e778ddbbd91a1885a19335e42e89250997fb99d1 | |
parent | 5a36666884eda9ec5b22aea3adf4efd388b22b06 (diff) | |
download | android_hardware_ril-47a94aacc60560363ea948835862613a6327b5f8.tar.gz android_hardware_ril-47a94aacc60560363ea948835862613a6327b5f8.tar.bz2 android_hardware_ril-47a94aacc60560363ea948835862613a6327b5f8.zip |
libril: Protect against NULL unsolicited response function
Upstream change I732234a22328a1bfcb603bb020547f543b6fd766 makes
RIL_UNSOL_DC_RT_INFO_CHANGED's responseFunction() NULL, without
protecting against it in RIL_onUnsolicitedResponse(), thus crash-
ing at least hammerhead's RIL stack upon mobile data connection.
https://android-review.googlesource.com/#/c/platform/hardware/ril/+/345950/
Change-Id: I6567019cb6daf6492a29e04cc9872e69b2ba456d
Signed-off-by: D. Andrei Măceș <Andrei.Maces@alumni.nd.edu>
-rw-r--r-- | libril/ril.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libril/ril.cpp b/libril/ril.cpp index 5e3f67d..c60cd6b 100644 --- a/libril/ril.cpp +++ b/libril/ril.cpp @@ -805,9 +805,11 @@ void RIL_onUnsolicitedResponse(int unsolResponse, const void *data, assert(rwlockRet == 0); } - ret = s_unsolResponses[unsolResponseIndex].responseFunction( - (int) soc_id, responseType, 0, RIL_E_SUCCESS, const_cast<void*>(data), - datalen); + if (s_unsolResponses[unsolResponseIndex].responseFunction) { + ret = s_unsolResponses[unsolResponseIndex].responseFunction( + (int) soc_id, responseType, 0, RIL_E_SUCCESS, const_cast<void*>(data), + datalen); + } rwlockRet = pthread_rwlock_unlock(radioServiceRwlockPtr); assert(rwlockRet == 0); |