Fix SVACE, Coverity issues 55/225755/2
authorHeeyong Song <heeyong.song@samsung.com>
Mon, 24 Feb 2020 08:36:13 +0000 (17:36 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Mon, 2 Mar 2020 04:40:52 +0000 (04:40 +0000)
- After having been compared to NULL value, pointer 'start' is dereferenced.
- Redundant comparison '(0 != forward)' is always 'true'.
- Use after free (USE_AFTER_FREE) - this->v.

Change-Id: I1860c13ac77311f249688294f90efcb3f1d4868a

dali/internal/accessibility/tizen-wayland/atspi/bridge-accessible.cpp
dali/internal/accessibility/tizen-wayland/atspi/dbus-tizen.cpp

index a9dc55c..dd3bd71 100644 (file)
@@ -602,11 +602,14 @@ Accessible* BridgeAccessible::CalculateNeighbor( Accessible* root, Accessible* s
     {
       auto deputy = DeputyOfProxyInParentGet( node );
       next_related_in_direction =
-          GetObjectInRelation( deputy, forward ? RelationType::FLOWS_TO : RelationType::FLOWS_FROM );
+          GetObjectInRelation( deputy, RelationType::FLOWS_TO );
     }
 
-    if( next_related_in_direction && start->GetStates()[State::DEFUNCT] )
+    if( next_related_in_direction && start && start->GetStates()[State::DEFUNCT] )
+    {
       next_related_in_direction = NULL;
+    }
+
     unsigned char want_cycle_detection = 0;
     if( next_related_in_direction )
     {
index 45ce50d..c657284 100644 (file)
@@ -756,9 +756,11 @@ struct DefaultDBusWrapper : public DBusWrapper
       destructors.push_back([=]()
         {
           DBUS_DEBUG( "unregistering interface %p", v );
+          {
+            std::lock_guard< std::mutex > lock( globalEntriesMutex );
+            globalEntries.erase( v );
+          }
           eldbus_service_interface_unregister( v );
-          std::lock_guard< std::mutex > lock( globalEntriesMutex );
-          globalEntries.erase( v );
         }
       );
     }