Add a null check of the argument "sim_id" 46/197646/1
authoryeji kim <yeji01.kim@samsung.com>
Tue, 15 Jan 2019 02:01:28 +0000 (11:01 +0900)
committeryeji kim <yeji01.kim@samsung.com>
Tue, 15 Jan 2019 02:01:28 +0000 (11:01 +0900)
Change-Id: I36dcd60536ff29ccdf0aee18c037ff3c7db7aa27
Signed-off-by: yeji kim <yeji01.kim@samsung.com>
libs/restriction.cpp

index 1544b3f..3528641 100644 (file)
@@ -485,6 +485,7 @@ EXPORT_API int dpm_restriction_get_popimap_email_state(device_policy_manager_h h
 EXPORT_API int dpm_restriction_set_messaging_state(device_policy_manager_h handle, const char *sim_id, int allow)
 {
        RET_ON_FAILURE(handle, DPM_ERROR_INVALID_PARAMETER);
+       RET_ON_FAILURE(sim_id, DPM_ERROR_INVALID_PARAMETER);
 
        DevicePolicyClient &client = GetDevicePolicyClient(handle);
 
@@ -500,6 +501,7 @@ EXPORT_API int dpm_restriction_set_messaging_state(device_policy_manager_h handl
 EXPORT_API int dpm_restriction_get_messaging_state(device_policy_manager_h handle, const char *sim_id, int *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);