[libnet-dbus-perl] 283/335: Fix warning due to possible undefined $interface in message

Intrigeri intrigeri at moszumanska.debian.org
Sat Mar 21 01:08:10 UTC 2015


This is an automated email from the git hooks/post-receive script.

intrigeri pushed a commit to branch experimental
in repository libnet-dbus-perl.

commit be2f49ba74853c3f471c7eda25c11108bca1900c
Author: Daniel P. Berrange <dan at berrange.com>
Date:   Tue Jun 28 22:36:57 2011 +0100

    Fix warning due to possible undefined $interface in message
---
 AUTHORS                | 1 +
 lib/Net/DBus/Object.pm | 6 ++++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/AUTHORS b/AUTHORS
index 3065b00..dd23fc4 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -15,6 +15,7 @@ from
     Dave Belser <dbelser-at-aerosat-dot-com>
     Stefan Pfetzing <dreamind at dreamind.de>
     Pavel Strashkin <pavel.strashkin at gmail.com>
+    Mathieu Bridon <bochecha at fedoraproject.org>
 
     [...send patches to get your name here!]
 
diff --git a/lib/Net/DBus/Object.pm b/lib/Net/DBus/Object.pm
index af5d5ad..1311dd5 100644
--- a/lib/Net/DBus/Object.pm
+++ b/lib/Net/DBus/Object.pm
@@ -474,7 +474,8 @@ sub _dispatch {
     my $reply;
     my $method_name = $message->get_member;
     my $interface = $message->get_interface;
-    if ($interface eq "org.freedesktop.DBus.Introspectable") {
+    if ((defined $interface) &&
+	($interface eq "org.freedesktop.DBus.Introspectable")) {
 	if ($method_name eq "Introspect" &&
 	    $self->_introspector &&
 	    $ENABLE_INTROSPECT) {
@@ -483,7 +484,8 @@ sub _dispatch {
 
 	    $self->_introspector->encode($reply, "methods", $method_name, "returns", $xml);
 	}
-    } elsif ($interface eq "org.freedesktop.DBus.Properties") {
+    } elsif ((defined $interface) &&
+	     ($interface eq "org.freedesktop.DBus.Properties")) {
 	if ($method_name eq "Get") {
 	    $reply = $self->_dispatch_prop_read($connection, $message);
 	} elsif ($method_name eq "GetAll") {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libnet-dbus-perl.git



More information about the Pkg-perl-cvs-commits mailing list