static int g_feature_enabled = -1;
-static int g_privilege_allowed = -1;
+static int g_privilege_allowed = 1; /* Always True */
static cynara *p_cynara = NULL;
static int __vc_cmd_get_feature_enabled()
static int __vc_cmd_check_privilege()
{
- char uid[16];
- int ret = -1;
+ char uid[16];
if (0 == g_privilege_allowed) {
SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Permission is denied");
}
g_privilege_allowed = 1;
- return VC_ERROR_NONE;
+
+ return VC_ERROR_NONE;
}
int vc_cmd_list_create(vc_cmd_list_h* vc_cmd_list)
iter = g_slist_nth(list->list, 0);
for (i = 0; i < count; i++) {
+ if (NULL == iter) {
+ SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] No command in list");
+ return VC_ERROR_OPERATION_FAILED;
+ }
+
temp_cmd = iter->data;
if (NULL != temp_cmd) {
iter = g_slist_nth(list->list, 0);
for (i = 0; i < count; i++) {
+ if (NULL == iter) {
+ SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] No command in list");
+ return VC_ERROR_OPERATION_FAILED;
+ }
if (NULL != iter->data) {
iter_cmd = iter->data;