# HG changeset patch # User Kim Alvefur # Date 1461931261 -7200 # Node ID 228396da1e2736af22328c69ce34bc360d83aac7 # Parent f9744effae04a7b4fbf8e553d1e5d5103f473e09 MUC: Stricter validation of deserialized data diff -r f9744effae04 -r 228396da1e27 plugins/muc/muc.lib.lua --- a/plugins/muc/muc.lib.lua Thu Apr 28 23:34:19 2016 +0200 +++ b/plugins/muc/muc.lib.lua Fri Apr 29 14:01:01 2016 +0200 @@ -1358,7 +1358,7 @@ 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 @@ 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);