Commit 709556c2 authored by Lukas0610's avatar Lukas0610 Committed by Stricted

libril: ensure no NULL-ptrs are passed for user/pass in setDataProfile

Change-Id: Ief1ad87e47a7a2d56dbed80484c009d2ad7f1a2a
parent 28ad515f
......@@ -2413,6 +2413,19 @@ Return<void> RadioImpl::setDataProfile(int32_t serial, const hidl_vec<DataProfil
success = false;
}
// FIXUP: at least the libsec-ril on zero can't handle user and password
// being passed as NULL-pointers. Copy an empty string into it to work around
static hidl_string HIDL_EMPTY = hidl_string("");
if (success && dataProfiles[i].user == NULL && !copyHidlStringToRil(
&dataProfiles[i].user, HIDL_EMPTY, pRI)) {
success = false;
}
if (success && dataProfiles[i].password == NULL && !copyHidlStringToRil(
&dataProfiles[i].password, HIDL_EMPTY, pRI)) {
success = false;
}
if (!success) {
freeSetDataProfileData(num, dataProfiles, dataProfilePtrs, 4,
&RIL_DataProfileInfo::apn, &RIL_DataProfileInfo::protocol,
......@@ -2487,6 +2500,19 @@ Return<void> RadioImpl::setDataProfile(int32_t serial, const hidl_vec<DataProfil
success = false;
}
// FIXUP: at least the libsec-ril on zero can't handle user and password
// being passed as NULL-pointers. Copy an empty string into it to work around
static hidl_string HIDL_EMPTY = hidl_string("");
if (success && dataProfiles[i].user == NULL && !copyHidlStringToRil(
&dataProfiles[i].user, HIDL_EMPTY, pRI)) {
success = false;
}
if (success && dataProfiles[i].password == NULL && !copyHidlStringToRil(
&dataProfiles[i].password, HIDL_EMPTY, pRI)) {
success = false;
}
if (!success) {
freeSetDataProfileData(num, dataProfiles, dataProfilePtrs, 6,
&RIL_DataProfileInfo_v15::apn, &RIL_DataProfileInfo_v15::protocol,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment