From 7e054bf6834cde6e5c9de895c8e2b0d7f1a094c5 Mon Sep 17 00:00:00 2001 From: Abhishek Vijay Date: Mon, 30 Sep 2019 15:31:48 +0530 Subject: ASAN Issue fixes Change-Id: I9c26c8092245453eda03b7e380eaeba000995b0a Signed-off-by: Abhishek Vijay --- src/sync-service/SyncManager_RepositoryEngine.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/sync-service/SyncManager_RepositoryEngine.cpp b/src/sync-service/SyncManager_RepositoryEngine.cpp index e2b16f0..7ed6243 100644 --- a/src/sync-service/SyncManager_RepositoryEngine.cpp +++ b/src/sync-service/SyncManager_RepositoryEngine.cpp @@ -1946,11 +1946,17 @@ RepositoryEngine::UpdateSyncJobToDB(const char *SvcAppId, int UserId, const char char *update_query = NULL; string SvcPkgId = SyncManager::GetInstance()->GetPkgIdByAppId(SvcAppId); + char *svc_pkg_id = new char[SvcPkgId.size() + 1]; + copy(SvcPkgId.begin(), SvcPkgId.end(), svc_pkg_id); + svc_pkg_id[SvcPkgId.size() + 1] = '\0'; + update_query = sqlite3_mprintf("UPDATE %Q SET AppStatus=%Q, SyncJobId=%Q, AccountId=%Q, Interval=%Q, " "Expedit=%Q, NoRetry=%Q, UserDataKey=%Q, UserDataValue=%Q " "WHERE SvcAppId=%Q AND PkgName=%Q AND UserId=%Q AND SyncType=%Q AND JobName=%Q", SYNC_JOB_TABLE, AppStatus, jobId, accId, interval, expedit, noRetry, UserKey, UserValue, - SvcAppId, SvcPkgId.c_str(), uid, SyncType, JobName); + SvcAppId, svc_pkg_id, uid, SyncType, JobName); + + delete[] svc_pkg_id; sqlite3_stmt *stmt = NULL; int ret = SQLITE_OK; -- cgit v1.2.3