aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2011-11-21 19:59:38 +0500
committerWaqas Hussain <waqas20@gmail.com>2011-11-21 19:59:38 +0500
commitf130f2703e3724623b43a06166132f9102480707 (patch)
tree408db5a5b39df7393c978a644a54b52ec9e01453
parentf64aa48b0f869bfd05272715264d41328bb8ae81 (diff)
downloadprosody-f130f2703e3724623b43a06166132f9102480707.tar.gz
prosody-f130f2703e3724623b43a06166132f9102480707.zip
MUC: Fix a possible stack overflow (when a local component joins a room, then disconnects, an unavailble-error presence cycle can occur).
-rw-r--r--plugins/muc/muc.lib.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua
index 8e05bbb4..731f9e37 100644
--- a/plugins/muc/muc.lib.lua
+++ b/plugins/muc/muc.lib.lua
@@ -358,6 +358,7 @@ function room_mt:handle_to_occupant(origin, stanza) -- PM, vCards, etc
elseif type == "unavailable" then -- unavailable
if current_nick then
log("debug", "%s leaving %s", current_nick, room);
+ self._jid_nick[from] = nil;
local occupant = self._occupants[current_nick];
local new_jid = next(occupant.sessions);
if new_jid == from then new_jid = next(occupant.sessions, new_jid); end
@@ -382,7 +383,6 @@ function room_mt:handle_to_occupant(origin, stanza) -- PM, vCards, etc
self:broadcast_presence(pr, from);
self._occupants[current_nick] = nil;
end
- self._jid_nick[from] = nil;
end
elseif not type then -- available
if current_nick then