代码绕过CFI防护整改

Signed-off-by: zhangdd_ewan <zhangdongdong50@huawei.com>
This commit is contained in:
zhangdd_ewan 2024-06-24 21:13:39 +08:00
parent 07055d86fe
commit 09e3dab777
2 changed files with 3 additions and 4 deletions

View File

@ -49,11 +49,10 @@ public:
virtual void UnloadI18nServiceAbility() = 0;
private:
/**
* @brief Construct map from request codes to request handling functions.
*/
int32_t InitInnerFuncMap(uint32_t code, MessageParcel &data, MessageParcel &reply);
int32_t InvokeInnerFunc(uint32_t code, MessageParcel &data, MessageParcel &reply);
/**
* @brief Check whether caller's token type is system app or shell, and has UPDATE_CONFIGURATION permission.

View File

@ -49,7 +49,7 @@ int32_t I18nServiceAbilityStub::OnRemoteRequest(uint32_t code, MessageParcel &da
return 0;
}
// map request code to corresponding process function.
int32_t ret = InitInnerFuncMap(code, data, reply);
int32_t ret = InvokeInnerFunc(code, data, reply);
bool hasMappedInnerFunc = ret > -1;
if (!hasMappedInnerFunc) {
HILOG_INFO_I18N("I18nServiceAbilityStub::OnRemoteRequest invalid request code=%{public}u", code);
@ -60,7 +60,7 @@ int32_t I18nServiceAbilityStub::OnRemoteRequest(uint32_t code, MessageParcel &da
return ret;
}
int32_t I18nServiceAbilityStub::InitInnerFuncMap(uint32_t code, MessageParcel &data, MessageParcel &reply)
int32_t I18nServiceAbilityStub::InvokeInnerFunc(uint32_t code, MessageParcel &data, MessageParcel &reply)
{
switch (code) {
case static_cast<uint32_t>(ILocaleConfigAbilityCode::SET_SYSTEM_LANGUAGE): {