diff options
author | Kim Alvefur <zash@zash.se> | 2016-04-29 14:01:01 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2016-04-29 14:01:01 +0200 |
commit | 47a1e0374cc0432e08b28b004fcecc9113d81643 (patch) | |
tree | 4d8dc28a19fb55becfd1111d3d3c9880d788cb5c /plugins/muc/muc.lib.lua | |
parent | 4de2428b7b4c4f869d16c1b8f5701d9206665fd2 (diff) | |
download | prosody-47a1e0374cc0432e08b28b004fcecc9113d81643.tar.gz prosody-47a1e0374cc0432e08b28b004fcecc9113d81643.zip |
MUC: Stricter validation of deserialized data
Diffstat (limited to 'plugins/muc/muc.lib.lua')
-rw-r--r-- | plugins/muc/muc.lib.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua index 071f1f8b..9a7b1f85 100644 --- a/plugins/muc/muc.lib.lua +++ b/plugins/muc/muc.lib.lua @@ -1358,7 +1358,7 @@ function _M.restore_room(frozen) if not resource and type(data) == "string" then -- bare jid: affiliation room._affiliations[jid] = data; - elseif host == room_host and node == room_name and resource then + elseif host == room_host and node == room_name and resource and type(data) == "table" then -- full room jid: bare real jid and role local bare_jid = data.bare_jid; local occupant = occupant_lib.new(bare_jid, jid); @@ -1372,7 +1372,7 @@ function _M.restore_room(frozen) end end occupant_sessions[bare_jid] = nil; - else + elseif type(data) == "table" and data.name then -- full user jid: presence local presence = st.deserialize(data); local bare_jid = jid_bare(jid); |