Android-x86
Fork

  • R/O
  • HTTP
  • SSH
  • HTTPS

hardware-ril: コミット

hardware/ril


コミットメタ情報

リビジョン13058cb71f03066fb81d1652f3dc3ffa050f3c7b (tree)
日時2017-06-09 02:26:40
作者Amit Mahajan <amitmahajan@goog...>
コミッターAmit Mahajan

ログメッセージ

Treat NULL payload in RIL messages as valid where applicable.

Test: basic telephony sanity
Bug: 62262047
Change-Id: Icdd199025b8890e8be66a18d47dff0f991ff4308

変更サマリ

差分

--- a/libril/ril_service.cpp
+++ b/libril/ril_service.cpp
@@ -2974,7 +2974,8 @@ int radio::getCurrentCallsResponse(int slotId,
29742974 populateResponseInfo(responseInfo, serial, responseType, e);
29752975
29762976 hidl_vec<Call> calls;
2977- if (response == NULL || (responseLen % sizeof(RIL_Call *)) != 0) {
2977+ if ((response == NULL && responseLen != 0)
2978+ || (responseLen % sizeof(RIL_Call *)) != 0) {
29782979 RLOGE("getCurrentCallsResponse: Invalid response");
29792980 if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
29802981 } else {
@@ -3770,9 +3771,11 @@ int radio::setupDataCallResponse(int slotId,
37703771 populateResponseInfo(responseInfo, serial, responseType, e);
37713772
37723773 SetupDataCallResult result = {};
3773- if (response == NULL || responseLen != sizeof(RIL_Data_Call_Response_v11)) {
3774- RLOGE("setupDataCallResponse: Invalid response");
3775- if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
3774+ if (response == NULL || (responseLen % sizeof(RIL_Data_Call_Response_v11)) != 0) {
3775+ if (response != NULL) {
3776+ RLOGE("setupDataCallResponse: Invalid response");
3777+ if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
3778+ }
37763779 result.status = DataCallFailCause::ERROR_UNSPECIFIED;
37773780 result.type = hidl_string();
37783781 result.ifname = hidl_string();
@@ -3938,7 +3941,8 @@ int radio::getCallForwardStatusResponse(int slotId,
39383941 populateResponseInfo(responseInfo, serial, responseType, e);
39393942 hidl_vec<CallForwardInfo> callForwardInfos;
39403943
3941- if (response == NULL || responseLen % sizeof(RIL_CallForwardInfo *) != 0) {
3944+ if ((response == NULL && responseLen != 0)
3945+ || responseLen % sizeof(RIL_CallForwardInfo *) != 0) {
39423946 RLOGE("getCallForwardStatusResponse Invalid response: NULL");
39433947 if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
39443948 } else {
@@ -4266,7 +4270,8 @@ int radio::getAvailableNetworksResponse(int slotId,
42664270 RadioResponseInfo responseInfo = {};
42674271 populateResponseInfo(responseInfo, serial, responseType, e);
42684272 hidl_vec<OperatorInfo> networks;
4269- if (response == NULL || responseLen % (4 * sizeof(char *))!= 0) {
4273+ if ((response == NULL && responseLen != 0)
4274+ || responseLen % (4 * sizeof(char *))!= 0) {
42704275 RLOGE("getAvailableNetworksResponse Invalid response: NULL");
42714276 if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
42724277 } else {
@@ -4460,7 +4465,8 @@ int radio::getDataCallListResponse(int slotId,
44604465 populateResponseInfo(responseInfo, serial, responseType, e);
44614466
44624467 hidl_vec<SetupDataCallResult> ret;
4463- if (response == NULL || responseLen % sizeof(RIL_Data_Call_Response_v11) != 0) {
4468+ if ((response == NULL && responseLen != 0)
4469+ || responseLen % sizeof(RIL_Data_Call_Response_v11) != 0) {
44644470 RLOGE("getDataCallListResponse: invalid response");
44654471 if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
44664472 } else {
@@ -4570,7 +4576,7 @@ int radio::getAvailableBandModesResponse(int slotId,
45704576 RadioResponseInfo responseInfo = {};
45714577 populateResponseInfo(responseInfo, serial, responseType, e);
45724578 hidl_vec<RadioBandMode> modes;
4573- if (response == NULL || responseLen % sizeof(int) != 0) {
4579+ if ((response == NULL && responseLen != 0)|| responseLen % sizeof(int) != 0) {
45744580 RLOGE("getAvailableBandModesResponse Invalid response: NULL");
45754581 if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
45764582 } else {
@@ -4737,7 +4743,8 @@ int radio::getNeighboringCidsResponse(int slotId,
47374743 populateResponseInfo(responseInfo, serial, responseType, e);
47384744 hidl_vec<NeighboringCell> cells;
47394745
4740- if (response == NULL || responseLen % sizeof(RIL_NeighboringCell *) != 0) {
4746+ if ((response == NULL && responseLen != 0)
4747+ || responseLen % sizeof(RIL_NeighboringCell *) != 0) {
47414748 RLOGE("getNeighboringCidsResponse Invalid response: NULL");
47424749 if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
47434750 } else {
@@ -5040,7 +5047,8 @@ int radio::getGsmBroadcastConfigResponse(int slotId,
50405047 populateResponseInfo(responseInfo, serial, responseType, e);
50415048 hidl_vec<GsmBroadcastSmsConfigInfo> configs;
50425049
5043- if (response == NULL || responseLen % sizeof(RIL_GSM_BroadcastSmsConfigInfo *) != 0) {
5050+ if ((response == NULL && responseLen != 0)
5051+ || responseLen % sizeof(RIL_GSM_BroadcastSmsConfigInfo *) != 0) {
50445052 RLOGE("getGsmBroadcastConfigResponse Invalid response: NULL");
50455053 if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
50465054 } else {
@@ -5124,7 +5132,8 @@ int radio::getCdmaBroadcastConfigResponse(int slotId,
51245132 populateResponseInfo(responseInfo, serial, responseType, e);
51255133 hidl_vec<CdmaBroadcastSmsConfigInfo> configs;
51265134
5127- if (response == NULL || responseLen % sizeof(RIL_CDMA_BroadcastSmsConfigInfo *) != 0) {
5135+ if ((response == NULL && responseLen != 0)
5136+ || responseLen % sizeof(RIL_CDMA_BroadcastSmsConfigInfo *) != 0) {
51285137 RLOGE("getCdmaBroadcastConfigResponse Invalid response: NULL");
51295138 if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
51305139 } else {
@@ -5545,7 +5554,8 @@ int radio::getCellInfoListResponse(int slotId,
55455554 populateResponseInfo(responseInfo, serial, responseType, e);
55465555
55475556 hidl_vec<CellInfo> ret;
5548- if (response == NULL || responseLen % sizeof(RIL_CellInfo_v12) != 0) {
5557+ if ((response == NULL && responseLen != 0)
5558+ || responseLen % sizeof(RIL_CellInfo_v12) != 0) {
55495559 RLOGE("getCellInfoListResponse: Invalid response");
55505560 if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
55515561 } else {
@@ -5699,7 +5709,9 @@ int radio::iccOpenLogicalChannelResponse(int slotId,
56995709 int numInts = responseLen / sizeof(int);
57005710 if (response == NULL || responseLen % sizeof(int) != 0) {
57015711 RLOGE("iccOpenLogicalChannelResponse Invalid response: NULL");
5702- if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
5712+ if (response != NULL) {
5713+ if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
5714+ }
57035715 } else {
57045716 int *pInt = (int *) response;
57055717 channelId = pInt[0];
@@ -5900,7 +5912,8 @@ int radio::getHardwareConfigResponse(int slotId,
59005912 populateResponseInfo(responseInfo, serial, responseType, e);
59015913
59025914 hidl_vec<HardwareConfig> result;
5903- if (response == NULL || responseLen % sizeof(RIL_HardwareConfig) != 0) {
5915+ if ((response == NULL && responseLen != 0)
5916+ || responseLen % sizeof(RIL_HardwareConfig) != 0) {
59045917 RLOGE("hardwareConfigChangedInd: invalid response");
59055918 if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
59065919 } else {
@@ -6350,7 +6363,7 @@ int radio::sendRequestStringsResponse(int slotId,
63506363 populateResponseInfo(responseInfo, serial, responseType, e);
63516364 hidl_vec<hidl_string> data;
63526365
6353- if (response == NULL || responseLen % sizeof(char *) != 0) {
6366+ if ((response == NULL && responseLen != 0) || responseLen % sizeof(char *) != 0) {
63546367 RLOGE("sendRequestStringsResponse Invalid response: NULL");
63556368 if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
63566369 } else {
@@ -6698,7 +6711,8 @@ int radio::dataCallListChangedInd(int slotId,
66986711 int indicationType, int token, RIL_Errno e, void *response,
66996712 size_t responseLen) {
67006713 if (radioService[slotId] != NULL && radioService[slotId]->mRadioIndication != NULL) {
6701- if (response == NULL || responseLen % sizeof(RIL_Data_Call_Response_v11) != 0) {
6714+ if ((response == NULL && responseLen != 0)
6715+ || responseLen % sizeof(RIL_Data_Call_Response_v11) != 0) {
67026716 RLOGE("dataCallListChangedInd: invalid response");
67036717 return 0;
67046718 }
@@ -7581,7 +7595,7 @@ int radio::cellInfoListInd(int slotId,
75817595 int indicationType, int token, RIL_Errno e, void *response,
75827596 size_t responseLen) {
75837597 if (radioService[slotId] != NULL && radioService[slotId]->mRadioIndication != NULL) {
7584- if (response == NULL || responseLen % sizeof(RIL_CellInfo_v12) != 0) {
7598+ if ((response == NULL && responseLen != 0) || responseLen % sizeof(RIL_CellInfo_v12) != 0) {
75857599 RLOGE("cellInfoListInd: invalid response");
75867600 return 0;
75877601 }
@@ -7702,7 +7716,8 @@ int radio::hardwareConfigChangedInd(int slotId,
77027716 int indicationType, int token, RIL_Errno e, void *response,
77037717 size_t responseLen) {
77047718 if (radioService[slotId] != NULL && radioService[slotId]->mRadioIndication != NULL) {
7705- if (response == NULL || responseLen % sizeof(RIL_HardwareConfig) != 0) {
7719+ if ((response == NULL && responseLen != 0)
7720+ || responseLen % sizeof(RIL_HardwareConfig) != 0) {
77067721 RLOGE("hardwareConfigChangedInd: invalid response");
77077722 return 0;
77087723 }
旧リポジトリブラウザで表示