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
commit5b06f8946f51c90fe3dd4ed9cfba91e5ad83f1b7 (patch)
tree3f0efc2d3878a700aeeef5009829a4c1822c6231 /plugins
parent4b548a129b90bbd17606bfcfe79bda47731ebe5d (diff)
downloadprosody-5b06f8946f51c90fe3dd4ed9cfba91e5ad83f1b7.tar.gz
prosody-5b06f8946f51c90fe3dd4ed9cfba91e5ad83f1b7.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