Add a null check of the argument "sim_id" 47/197647/1
authoryeji kim <yeji01.kim@samsung.com>
Tue, 15 Jan 2019 02:04:35 +0000 (11:04 +0900)
committeryeji kim <yeji01.kim@samsung.com>
Tue, 15 Jan 2019 02:04:35 +0000 (11:04 +0900)
Change-Id: I02ddeebac698e5315fd8b7e4bf57fc4939bbf9b9
Signed-off-by: yeji kim <yeji01.kim@samsung.com>
api/telephony.cpp

index bccc314e69e9920638d8170baa33170d49b0ba97..74e6c55b825e5e961d9c407e2fa08578f4435250 100644 (file)
@@ -30,6 +30,7 @@
 EXPORT_API int dpm_telephony_set_messaging_state(device_policy_manager_h handle, const char *sim_id, bool allow)
 {
        RET_ON_FAILURE(handle, DPM_ERROR_INVALID_PARAMETER);
+       RET_ON_FAILURE(sim_id, DPM_ERROR_INVALID_PARAMETER);
 
        DevicePolicyClient &client = GetDevicePolicyClient(handle);
 
@@ -45,6 +46,7 @@ EXPORT_API int dpm_telephony_set_messaging_state(device_policy_manager_h handle,
 EXPORT_API int dpm_telephony_get_messaging_state(device_policy_manager_h handle, const char *sim_id, bool *is_allowed)
 {
        RET_ON_FAILURE(handle, DPM_ERROR_INVALID_PARAMETER);
+       RET_ON_FAILURE(sim_id, DPM_ERROR_INVALID_PARAMETER);
        RET_ON_FAILURE(is_allowed, DPM_ERROR_INVALID_PARAMETER);
 
        DevicePolicyClient &client = GetDevicePolicyClient(handle);