diff options
author | Kim Alvefur <zash@zash.se> | 2019-11-25 20:52:01 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2019-11-25 20:52:01 +0100 |
commit | 7954f16d5913ce2383e220c040e36b153ac522e3 (patch) | |
tree | b016011e7c177c36a6f9c301630b7f3458b5f78c /util | |
parent | 7fdb06225efa628956ee38d944bd45d811bac358 (diff) | |
download | prosody-7954f16d5913ce2383e220c040e36b153ac522e3.tar.gz prosody-7954f16d5913ce2383e220c040e36b153ac522e3.zip |
util.stanza: Check that argument to error_reply is a stanza
Diffstat (limited to 'util')
-rw-r--r-- | util/stanza.lua | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/util/stanza.lua b/util/stanza.lua index 919d983c..24fd4fea 100644 --- a/util/stanza.lua +++ b/util/stanza.lua @@ -448,6 +448,9 @@ end local xmpp_stanzas_attr = { xmlns = xmlns_stanzas }; local function error_reply(orig, error_type, condition, error_message) + if not is_stanza(orig) then + error("bad argument to error_reply: expected stanza, got "..type(orig)); + end local t = reply(orig); t.attr.type = "error"; t:tag("error", {type = error_type}) --COMPAT: Some day xmlns:stanzas goes here |