svace issue fixed. (17164, 19166, 19167, 84741, 99258 99505) 57/74657/2
authorLim DoHyung <delight.lim@samsung.com>
Wed, 15 Jun 2016 06:43:04 +0000 (15:43 +0900)
committerLim DoHyung <delight.lim@samsung.com>
Wed, 15 Jun 2016 06:47:06 +0000 (23:47 -0700)
# commit format
[Issue] svace occur issue in browser code.
[Problem] omit syntax and Initialize array, throw proceed.
[Solution] I added and fix code.
[Verify] Launch the browser and success confirm.

Change-Id: Id6d07fda9964f327f953ddd98ab13ea5a4a866fc
Signed-off-by: Lim DoHyung <delight.lim@samsung.com>
services/HistoryService/HistoryItem.cpp
services/HistoryService/HistoryService.cpp
services/SimpleUI/SimpleUI.cpp

index c59d5ba4b764152c6757540bf3de80ee361c01e5..0ee8bddd3268c054182a4daac64fadae3e8a27e7 100644 (file)
@@ -15,6 +15,7 @@
  */
 
 #include "HistoryItem.h"
+#include "BrowserLogger.h"
 
 namespace tizen_browser
 {
@@ -23,7 +24,13 @@ namespace services
 
 HistoryItem::HistoryItem(HistoryItem && other) throw()
 {
-    *this = std::move(other);
+    try {
+        if (this != &other) {
+            *this = std::move(other);
+        }
+    } catch(...) {
+        BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
+    }
 }
 
 HistoryItem::HistoryItem(int id,
index a5051bba565d488a5d977b8717c89720dbebbdbc..d1085e124d35ea6044c5a693c267d88c1e08db8d 100755 (executable)
@@ -172,7 +172,7 @@ std::shared_ptr<HistoryItemVector> HistoryService::getMostVisitedHistoryItems()
 
     bp_history_offset offset = (BP_HISTORY_O_URL | BP_HISTORY_O_TITLE | BP_HISTORY_O_FREQUENCY | BP_HISTORY_O_FAVICON | BP_HISTORY_O_DATE_CREATED | BP_HISTORY_O_THUMBNAIL);
 
-    int freq_arr[1000];
+    int freq_arr[1000] = {0, };
     for(int i = 0; i< count; i++){
         int freq;
         if (0 == bp_history_adaptor_get_frequency(ids[i], &freq))
@@ -181,7 +181,7 @@ std::shared_ptr<HistoryItemVector> HistoryService::getMostVisitedHistoryItems()
         }
     }
 
-    int index_array[6];
+    int index_array[6] = {0, };
     int j=0;
     int maximum = freq_arr[0];
     int position = 0;
@@ -190,16 +190,16 @@ std::shared_ptr<HistoryItemVector> HistoryService::getMostVisitedHistoryItems()
         if(k > count || count == 0)
             break;
 
-    maximum = freq_arr[0];
-    position = 0;
+        maximum = freq_arr[0];
+        position = 0;
 
-    for(int i =1;i<count;i++){
-        if (freq_arr[i] > maximum)
+        for(int i =1;i<count;i++){
+            if (freq_arr[i] > maximum)
             {
                 maximum  = freq_arr[i];
                 position = i;
             }
-         }
+        }
         index_array[j++] = position;
         freq_arr[position] = -1;
     }
index 1640a9dba6bf237b6f7fc299d6e195f25b8682a5..126b43b13658f4a89d92d097c2fc2c3810d2c07f 100644 (file)
@@ -924,6 +924,7 @@ void SimpleUI::onSnapshotCaptured(std::shared_ptr<tools::BrowserImage> snapshot,
     switch (snapshot_type) {
     case tools::SnapshotType::ASYNC_LOAD_FINISHED:
         m_historyService->updateHistoryItemSnapshot(m_webEngine->getURI(), snapshot);
+        break;
     case tools::SnapshotType::ASYNC_TAB:
         m_tabService->updateTabItemSnapshot(m_webEngine->currentTabId(), snapshot);
         break;