ASAN issue resolved 70/295570/1 accepted/tizen/7.0/unified/20230713.041534
authorKamaljeet Chauhan <kamal.jc@samsung.com>
Tue, 30 May 2023 05:43:43 +0000 (11:13 +0530)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Tue, 11 Jul 2023 04:51:10 +0000 (04:51 +0000)
Change-Id: Iff8933cba5d454f187eb6255ce93e6f592b6a923
Signed-off-by: Kamaljeet Chauhan <kamal.jc@samsung.com>
(cherry picked from commit b4cfdd237db79e0b7b4c8038e22b63ac34f23297)

email-core/email-storage/email-storage.c

index 0b16e2b8f687c5e6c2045b2e9ab8166dbddc3232..2d661a5359d6f331e1d5167864857bc02103ed81 100755 (executable)
@@ -4963,7 +4963,7 @@ INTERNAL_FUNC int emstorage_add_account(char *multi_user_name, emstorage_account
        EM_DEBUG_DB_EXEC(SQLITE_OK != rc, {error = EMAIL_ERROR_DB_FAILURE; sqlite3_free_table(result); goto FINISH_OFF; },
                        ("SQL(%s) sqlite3_get_table fail:%d -%s", sql, rc, sqlite3_errmsg(local_db_handle)));
 
-       if (NULL == result[1]) rc = 1;
+       if (row_count == 0 || NULL == result[1]) rc = 1;
        else {
                for (i = 1; i <= row_count; i++) {
                        if (i != atoi(result[i]))