[AT-SPI] Fix logging object address in bridge-text.cpp 48/261348/3
authorArtur Świgoń <a.swigon@samsung.com>
Thu, 15 Jul 2021 13:50:34 +0000 (15:50 +0200)
committerArtur Świgoń <a.swigon@samsung.com>
Thu, 15 Jul 2021 15:00:55 +0000 (17:00 +0200)
The following commit introduced a null pointer dereference bug (by using
the wrong variable):

    commit 0f89686c3137b7972e41c44e48c0da5de385a360
    Author: Seoyeon Kim <seoyeon2.kim@samsung.com>
    Date:   Wed Jun 23 15:11:07 2021 +0900

        Update ATSPI code according to DALi coding rule

        <cut>
        Change-Id: Ie1a2f0185ed90846fba61a999bcea81038621ae0

The bug has been fixed by the following commit which, unfortunately,
does not restore logging the object address as is done in other
bridge-*.cpp files:

    commit 11d8929702373f3e7601b7e513f48bec42611844
    Author: David Steele <david.steele@samsung.com>
    Date:   Fri Jul 9 12:23:51 2021 +0100

        Fixing error found by static analyser

        Change-Id: I5f6083f6df7e007815c726b22d16c652a01b5be8

Note to people unfamiliar with the AT-SPI bridge: the std::domain_error
which is thrown here is serialized as an error reply on DBus which is
then sent back to the original caller (e.g. screen-reader).

Change-Id: I7e535220dbbdd78703db4af4395e5c3384db5405

dali/internal/accessibility/bridge/bridge-text.cpp

index c1d7b6b..d71a723 100644 (file)
@@ -48,7 +48,7 @@ Text* BridgeText::FindSelf() const
   auto textObject = dynamic_cast<Text*>(self);
   if(!textObject)
   {
-    throw std::domain_error{"Object doesn't have Text interface"};
+    throw std::domain_error{"Object " + self->GetAddress().ToString() + " doesn't have Text interface"};
   }
   return textObject;
 }