[libnet-dbus-perl] 323/335: Check that select is returning a valid state
Intrigeri
intrigeri at moszumanska.debian.org
Sat Mar 21 01:08:15 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 77d7a249f86fc0fca6d1765c914d4e360e211441
Author: Philip Boulain <philip.boulain at smoothwall.net>
Date: Mon Mar 16 18:49:57 2015 +0000
Check that select is returning a valid state
The Reactor's step() method assumes that any true select return value will
have set the fd vectors to then dispatch callbacks appropriately, but if
interrupted by a signal, select() returns -1 and leaves the vectors undefined.
In practice in Linux this can leave them all set (as given as input), which
will then cause handlers to misfire and potentialy block on read.
Fixes RT #84998
---
lib/Net/DBus/Reactor.pm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/Net/DBus/Reactor.pm b/lib/Net/DBus/Reactor.pm
index edefaeb..712938a 100644
--- a/lib/Net/DBus/Reactor.pm
+++ b/lib/Net/DBus/Reactor.pm
@@ -373,7 +373,7 @@ sub step {
my $n = select($ro=$ri,$wo=$wi,$eo=$ei, (defined $timeout ? ($timeout ? $timeout/1000 : 0) : undef));
@callbacks = ();
- if ($n) {
+ if ($n > 0) {
push @callbacks, $self->_dispatch_fd("read", $ro);
push @callbacks, $self->_dispatch_fd("write", $wo);
push @callbacks, $self->_dispatch_fd("error", $eo);
--
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