fix svace issue 21/103021/4 submit/tizen_3.0/20161207.052337
authorjkjo92 <jkjo92@samsung.com>
Wed, 7 Dec 2016 04:59:33 +0000 (13:59 +0900)
committerjkjo92 <jkjo92@samsung.com>
Wed, 7 Dec 2016 05:18:39 +0000 (14:18 +0900)
Change-Id: I3884c26571c10a6c64c698830b0a0532f1cfb14e

client/fido_uaf_client.c
server/fido_asm_plugin_manager.c
server/fido_server.c

index 6081e8d..bf94654 100755 (executable)
@@ -91,10 +91,6 @@ _fido_uaf_process_operation_reply(GObject *object, GAsyncResult *res, gpointer u
        }
 
        _fido_process_cb_data_s *cb_data = (_fido_process_cb_data_s *)user_data;
-       if (cb_data == NULL) {
-               _ERR("Can not proceed since callback data is NULL");
-               return;
-       }
 
        if (cb_data->cb == NULL) {
                _ERR("Can not proceed since callback data's cb part is NULL");
@@ -351,9 +347,6 @@ fido_uaf_set_server_result(int response_code, const char *uaf_response_json)
 
        if (is_success == FALSE) {
                _ERR("fido_call_fido_uaf_notify_result_sync failed [%d]", tizen_error_code);
-               if (dbus_err)
-                       _ERR("GError = [%s]", dbus_err->message);
-
                return FIDO_ERROR_PROTOCOL_ERROR;
        }
 
index 137ab82..46022f9 100644 (file)
@@ -315,10 +315,6 @@ _on_asm_dbus_reply(GObject *proxy, GAsyncResult *res, gpointer user_data)
        }
 
        _asm_ipc_cb_data_t *cb_data = (_asm_ipc_cb_data_t *)user_data;
-       if (cb_data == NULL) {
-               _ERR("Can not proceed since callback data is NULL");
-               return;
-       }
 
        if (cb_data->cb == NULL) {
                _ERR("Can not proceed since callback data's cb part is NULL");
index 09bafc1..65b2a2b 100755 (executable)
@@ -914,28 +914,29 @@ _discover_response_cb_for_process(int tz_error_code, int error_code, GList *avai
                                _INFO("_PROCESS_TYPE_CHECK_POLICY for auth");
                        }
 
-                       if (policy->is_keyid_present == true) {
-                               /*Available authenticators' keyIDs can be fetched via GetRegistrations ASM op*/
-                               _INFO("Need to call GetRegistrations to match policy");
-                               GList *avl_auth_list_full_temp = __get_auth_list_with_keyids(policy, available_authenticators);
-                               if (avl_auth_list_full_temp != NULL) {
-                                       g_list_free(available_authenticators_full);
-
-                                       available_authenticators_full = g_list_first(avl_auth_list_full_temp);
-                               }
-
-                       }
-                       GList *allowed_auth_list = _policy_checker_get_matched_auth_list(policy, available_authenticators_full);
-                       g_list_free_full(available_authenticators_full, _free_asm_auth_list);
+                       if (policy != NULL) {
+                               if (policy->is_keyid_present == true) {
+                                       /*Available authenticators' keyIDs can be fetched via GetRegistrations ASM op*/
+                                       _INFO("Need to call GetRegistrations to match policy");
+                                       GList *avl_auth_list_full_temp = __get_auth_list_with_keyids(policy, available_authenticators);
+                                       if (avl_auth_list_full_temp != NULL) {
+                                               g_list_free(available_authenticators_full);
+
+                                               available_authenticators_full = g_list_first(avl_auth_list_full_temp);
+                                       }
 
-                       if ((allowed_auth_list != NULL) && g_list_length(allowed_auth_list) > 0)
-                               _send_process_response(cb_data, FIDO_ERROR_NONE, NULL);
-                       else
-                               _send_process_response(cb_data, FIDO_ERROR_NO_SUITABLE_AUTHENTICATOR, NULL);
+                               }
+                               GList *allowed_auth_list = _policy_checker_get_matched_auth_list(policy, available_authenticators_full);
+                               g_list_free_full(available_authenticators_full, _free_asm_auth_list);
 
-                       if (allowed_auth_list != NULL)
-                               g_list_free_full(allowed_auth_list, _free_matched_auth_data);
+                               if ((allowed_auth_list != NULL) && g_list_length(allowed_auth_list) > 0)
+                                       _send_process_response(cb_data, FIDO_ERROR_NONE, NULL);
+                               else
+                                       _send_process_response(cb_data, FIDO_ERROR_NO_SUITABLE_AUTHENTICATOR, NULL);
 
+                               if (allowed_auth_list != NULL)
+                                       g_list_free_full(allowed_auth_list, _free_matched_auth_data);
+                       }
                } else if (strcmp(cb_data->uaf_req->header->operation, _UAF_OPERATION_NAME_KEY_DE_REG) == 0) {
 
                        _dereg_request_t *dereg_req = (_dereg_request_t*)(cb_data->uaf_req->data);