diff options
author | Jonatan Pålsson <jonatan.palsson@pelagicore.com> | 2014-01-14 12:40:13 +0100 |
---|---|---|
committer | Jonatan Pålsson <jonatan.palsson@pelagicore.com> | 2014-01-14 12:40:13 +0100 |
commit | 63edf7777f6af93c753790b9a5db38c25ee46331 (patch) | |
tree | 461077d0a1aad3081a7c119efb7fad697ef181cb | |
parent | f4b61821576a5ef95cf6dbf7a1ebcb94f1ab6efb (diff) | |
download | dbus-c++-63edf7777f6af93c753790b9a5db38c25ee46331.tar.gz |
Fix crash when invoking method without specifying interface
Previously this meant the interface variable is NULL, which led to an invalid
string conversion from NULL to string, causing a crash. Check for NULL before
doing the conversion.
-rw-r--r-- | src/object.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/object.cpp b/src/object.cpp index 96e20ba..d63454b 100644 --- a/src/object.cpp +++ b/src/object.cpp @@ -209,10 +209,15 @@ bool ObjectAdaptor::handle_message(const Message &msg) const CallMessage &cmsg = reinterpret_cast<const CallMessage &>(msg); const char *member = cmsg.member(); const char *interface = cmsg.interface(); + InterfaceAdaptor *ii = NULL; debug_log(" invoking method %s.%s", interface, member); - InterfaceAdaptor *ii = find_interface(interface); + if (interface) + ii = find_interface(interface); + else + ii = NULL; + if (ii) { try |