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 | 52b7181979bcee9000acf1c90e85934976e4da6a (patch) | |
tree | b016011e7c177c36a6f9c301630b7f3458b5f78c /util/stanza.lua | |
parent | 11095184a53cc144e37560b7bbbf4de19ce669c7 (diff) | |
download | prosody-52b7181979bcee9000acf1c90e85934976e4da6a.tar.gz prosody-52b7181979bcee9000acf1c90e85934976e4da6a.zip |
util.stanza: Check that argument to error_reply is a stanza
Diffstat (limited to 'util/stanza.lua')
-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 |