aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2019-12-23 23:28:44 +0100
committerKim Alvefur <zash@zash.se>2019-12-23 23:28:44 +0100
commitf35ffff6ae2bbee4d18ae932d2df177d289ba633 (patch)
tree3f0efc2d3878a700aeeef5009829a4c1822c6231 /plugins
parent0e1961a7c505cade31afd6a18c81c82c76493d6e (diff)
downloadprosody-f35ffff6ae2bbee4d18ae932d2df177d289ba633.tar.gz
prosody-f35ffff6ae2bbee4d18ae932d2df177d289ba633.zip
mod_muc_mam: Handle form identification error (e.g. not a form at all)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_muc_mam.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/plugins/mod_muc_mam.lua b/plugins/mod_muc_mam.lua
index 1df93a18..fd98e205 100644
--- a/plugins/mod_muc_mam.lua
+++ b/plugins/mod_muc_mam.lua
@@ -145,7 +145,10 @@ module:hook("iq-set/bare/"..xmlns_mam..":query", function(event)
local form = query:get_child("x", "jabber:x:data");
if form then
local form_type, err = get_form_type(form);
- if form_type ~= xmlns_mam then
+ if not form_type then
+ origin.send(st.error_reply(stanza, "modify", "bad-request", "Invalid dataform: "..err));
+ return true;
+ elseif form_type ~= xmlns_mam then
origin.send(st.error_reply(stanza, "modify", "bad-request", "Unexpected FORM_TYPE, expected '"..xmlns_mam.."'"));
return true;
end