Fix format overflow error for email-storage dlog macro 43/284843/1
authorMarek Pikuła <m.pikula@partner.samsung.com>
Mon, 28 Nov 2022 17:46:32 +0000 (18:46 +0100)
committerMarek Pikuła <m.pikula@partner.samsung.com>
Mon, 28 Nov 2022 17:46:32 +0000 (18:46 +0100)
Don't execute EM_DEBUG_LOG_SEC if one of the formatting arguments
is NULL. Otherwise, format-overflow compilation error is risen.

Change-Id: I3495eb16c2987e6d212d89b566ebebbd7e093012
Signed-off-by: Marek Pikuła <m.pikula@partner.samsung.com>
email-core/email-storage/email-storage.c

index 0b16e2b8f687c5e6c2045b2e9ab8166dbddc3232..bec5fd599a353df87f9b1d9fbcb1d5032b1aadfa 100755 (executable)
@@ -4513,10 +4513,14 @@ INTERNAL_FUNC int emstorage_update_account_password(char *multi_user_name, int i
                goto FINISH_OFF;
        }
 
-       EM_DEBUG_LOG_SEC("recv_password_file_name [%s] input_incoming_server_password [%s]",
-                       recv_password_file_name, input_incoming_server_password);
-       EM_DEBUG_LOG_SEC("send_password_file_name [%s] input_outgoing_server_password [%s]",
-                       send_password_file_name, input_outgoing_server_password);
+       if (input_incoming_server_password) {
+               EM_DEBUG_LOG_SEC("recv_password_file_name [%s] input_incoming_server_password [%s]",
+                               recv_password_file_name, input_incoming_server_password);
+       }
+       if (input_outgoing_server_password) {
+               EM_DEBUG_LOG_SEC("send_password_file_name [%s] input_outgoing_server_password [%s]",
+                               send_password_file_name, input_outgoing_server_password);
+       }
 
        if (input_incoming_server_password) {
                err = emcore_remove_password_in_key_manager(recv_password_file_name);
@@ -17904,7 +17908,7 @@ static  int emstorage_create_renamed_table(char *multi_user_name, char **input_f
        int rc = -1;
        sqlite3 *local_db_handle = NULL;
        char sql_query_string[QUERY_SIZE] = {0, };
-       
+
        local_db_handle = emstorage_get_db_connection(multi_user_name);
 
        if (input_full_query == NULL || input_source_table_name == NULL || input_new_table_name == NULL) {