From: Yunjin Lee Date: Thu, 16 Jun 2016 05:05:01 +0000 (+0900) Subject: Fix to handle invalid package type input parameter as an error X-Git-Tag: accepted/tizen/tv/20160616.105511 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Ftags%2Faccepted%2Ftizen%2Ftv%2F20160616.105511;p=platform%2Fcore%2Fsecurity%2Fprivilege-info.git Fix to handle invalid package type input parameter as an error Change-Id: I99f28e2f3648b64f680c3d6bf571bd5fe4924217 Signed-off-by: Yunjin Lee --- diff --git a/src/privilege_info.c b/src/privilege_info.c index 2233b01..5406c20 100755 --- a/src/privilege_info.c +++ b/src/privilege_info.c @@ -323,7 +323,9 @@ int privilege_info_get_display_name_by_pkgtype(const const char* package_type, c ret = privilege_info_get_display_name_string_id_by_pkgtype(package_type, api_version, privilege, &display_name_string_id); - if (ret == PRVINFO_ERROR_NO_MATCHING_PRIVILEGE) { + if (ret == PRVINFO_ERROR_INVALID_PARAMETER) { + return ret; + } else if (ret == PRVINFO_ERROR_NO_MATCHING_PRIVILEGE) { char* tempPrivilege = NULL; char* token = NULL; char* temp = NULL; @@ -433,7 +435,9 @@ int privilege_info_get_description_by_pkgtype(const char* package_type, const ch ret = privilege_info_get_description_string_id_by_pkgtype(package_type, api_version, privilege, &description_string_id); - if (ret == PRVINFO_ERROR_NO_MATCHING_PRIVILEGE) { + if (ret == PRVINFO_ERROR_INVALID_PARAMETER) { + return ret; + } else if (ret == PRVINFO_ERROR_NO_MATCHING_PRIVILEGE) { char* temp = NULL; temp = dgettext("privilege", "IDS_TPLATFORM_BODY_THIS_PRIVILEGE_IS_NOT_DEFINED"); *description = (char*)calloc(strlen(temp) + 1, sizeof(char));