diff options
author | Nilesh Trimbake <t.shripati@samsung.com> | 2018-05-24 20:03:38 +0530 |
---|---|---|
committer | Nilesh Trimbake <t.shripati@samsung.com> | 2018-05-24 20:32:30 +0530 |
commit | c0e7f192c5cdca0a2bd999aa08c70d4602defe57 (patch) | |
tree | b660d4963864d19c9829197b7d74b8f68d6770ea | |
parent | 12df546512f87beae755f525682e90298c15d144 (diff) | |
download | phone-contacts-tizen_5.0.tar.gz phone-contacts-tizen_5.0.tar.bz2 phone-contacts-tizen_5.0.zip |
Resolve SVACE issuetizen_5.5_src.m2_releasesubmit/tizen_5.5_wearable_hotfix/20201027.114701submit/tizen_5.5_wearable_hotfix/20201026.1843010submit/tizen_5.5_mobile_hotfix/20201125.191001submit/tizen_5.5_mobile_hotfix/20201027.114301submit/tizen_5.5_mobile_hotfix/20201026.1851010submit/tizen_5.5/20191031.000001submit/tizen_5.0/20181101.000009submit/tizen/20200205.125014submit/tizen/20180921.182133submit/tizen/20180831.131433submit/tizen/20180524.152721tizen_5.5_wearable_hotfixtizen_5.5_mobile_hotfixtizen_5.5tizen_5.0
Change-Id: I57bf68eb977a89ebad38a73484b8564fb4f7ded4
-rw-r--r-- | contacts-app/src/List/SearchView.cpp | 6 | ||||
-rw-r--r-- | contacts-app/src/OperationPickController.cpp | 4 | ||||
-rw-r--r-- | lib-apps-common/src/Ux/SearchUtils.cpp | 3 | ||||
-rw-r--r-- | lib-apps-common/src/Ux/SelectView.cpp | 2 | ||||
-rw-r--r-- | phone-app/inc/Logs/Utils.h | 3 | ||||
-rw-r--r-- | phone-app/src/Logs/Model/DateGroupProvider.cpp | 3 | ||||
-rw-r--r-- | phone-app/src/Logs/Utils.cpp | 3 |
7 files changed, 17 insertions, 7 deletions
diff --git a/contacts-app/src/List/SearchView.cpp b/contacts-app/src/List/SearchView.cpp index 52b4411..5d45eab 100644 --- a/contacts-app/src/List/SearchView.cpp +++ b/contacts-app/src/List/SearchView.cpp @@ -123,8 +123,10 @@ void SearchView::onResultPressed(Evas_Object *obj, const char *emission, const c m_ContactsView->setPersonFilter(personId); } else { auto listItem = (Ux::ListItem *) firstContactData.getUserData(); - listItem->scrollTo(); - listItem->select(); + if (listItem) { + listItem->scrollTo(); + listItem->select(); + } } getPage()->close(); diff --git a/contacts-app/src/OperationPickController.cpp b/contacts-app/src/OperationPickController.cpp index 398c508..e6868fd 100644 --- a/contacts-app/src/OperationPickController.cpp +++ b/contacts-app/src/OperationPickController.cpp @@ -49,7 +49,9 @@ void OperationPickController::onRequest(const char *operation, app_control_h req view->setSelectMode(selectMode); if (selectMode == SelectMulti) { int limit = App::getIntExtraData(request, APP_CONTROL_DATA_TOTAL_COUNT); - view->setSelectLimit(limit); + if (limit >= 0 && limit <= INT_MAX) { + view->setSelectLimit(limit); + } } SelectView::Strings strings = { }; diff --git a/lib-apps-common/src/Ux/SearchUtils.cpp b/lib-apps-common/src/Ux/SearchUtils.cpp index 7915505..303fce2 100644 --- a/lib-apps-common/src/Ux/SearchUtils.cpp +++ b/lib-apps-common/src/Ux/SearchUtils.cpp @@ -30,6 +30,9 @@ char *Ux::highlightSearchResult(const char *value, const SearchResult::MatchInfo size_t size = sizeof(RESULT_FORMAT) + strlen(value); char *buffer = (char *) malloc(size); + if (!buffer) { + return nullptr; + } snprintf(buffer, size, RESULT_FORMAT, match.offset, value, match.length, value + match.offset, value + match.offset + match.length); diff --git a/lib-apps-common/src/Ux/SelectView.cpp b/lib-apps-common/src/Ux/SelectView.cpp index 5012033..20b8084 100644 --- a/lib-apps-common/src/Ux/SelectView.cpp +++ b/lib-apps-common/src/Ux/SelectView.cpp @@ -97,7 +97,7 @@ void SelectView::setSelectLimit(size_t selectLimit) if (m_SelectLimit != selectLimit) { m_SelectLimit = selectLimit; - if (m_SelectLimit) { + if (m_SelectLimit > 0 && m_SelectLimit < INT_MAX) { m_IsMultiChecking = true; for (size_t i = m_Items.size() - 1; m_TotalSelectCount > m_SelectLimit; --i) { if (!m_Items[i]->isExcluded()) { diff --git a/phone-app/inc/Logs/Utils.h b/phone-app/inc/Logs/Utils.h index 66197d9..8744b7c 100644 --- a/phone-app/inc/Logs/Utils.h +++ b/phone-app/inc/Logs/Utils.h @@ -43,7 +43,8 @@ namespace Logs */ inline time_t removeTime(time_t time) { - tm date = removeTime(*localtime(&time)); + struct tm tm_buf; + tm date = removeTime(*localtime_r(&time, &tm_buf)); return mktime(&date); } diff --git a/phone-app/src/Logs/Model/DateGroupProvider.cpp b/phone-app/src/Logs/Model/DateGroupProvider.cpp index 076d1ff..51d40ac 100644 --- a/phone-app/src/Logs/Model/DateGroupProvider.cpp +++ b/phone-app/src/Logs/Model/DateGroupProvider.cpp @@ -30,7 +30,8 @@ template <typename MemberType> Group *DateGroupProvider<MemberType>::createGroup(DataItem &dataItem) { time_t logTime = static_cast<MemberType &>(dataItem).getTime(); - return new DateGroup(removeTime(*localtime(&logTime))); + struct tm tm_buf; + return new DateGroup(removeTime(*localtime_r(&logTime, &tm_buf))); } template <typename MemberType> diff --git a/phone-app/src/Logs/Utils.cpp b/phone-app/src/Logs/Utils.cpp index d57adec..6dabafa 100644 --- a/phone-app/src/Logs/Utils.cpp +++ b/phone-app/src/Logs/Utils.cpp @@ -54,7 +54,8 @@ std::string Logs::formatDate(time_t date) std::string Logs::formatDuration(time_t duration) { char buffer[BUFFER_SIZE]; - strftime(buffer, sizeof(buffer), duration > ONE_HOUR ? "%H:%M:%S" : "%M:%S", gmtime(&duration)); + struct tm tmp; + strftime(buffer, sizeof(buffer), duration > ONE_HOUR ? "%H:%M:%S" : "%M:%S", gmtime_r(&duration, &tmp)); return buffer; } |