Changeset

7413:228396da1e27

MUC: Stricter validation of deserialized data
author Kim Alvefur <zash@zash.se>
date Fri, 29 Apr 2016 14:01:01 +0200
parents 7412:f9744effae04
children 7414:1b62c89014c4
files plugins/muc/muc.lib.lua
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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);