From fa47490da4a5ede9e889181e7bcbb72cbefc2fab Mon Sep 17 00:00:00 2001 From: Badlop Date: Wed, 15 Apr 2015 13:37:09 +0200 Subject: [PATCH] Report problem when mod_rest receives malformed stanza (#65) --- mod_rest/src/mod_rest.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod_rest/src/mod_rest.erl b/mod_rest/src/mod_rest.erl index 1a9c2bc..4a4ccf9 100644 --- a/mod_rest/src/mod_rest.erl +++ b/mod_rest/src/mod_rest.erl @@ -64,7 +64,7 @@ process(Path, Request) -> %% Otherwise, it is considered an ejabberd command to execute. maybe_post_request([$< | _ ] = Data, Host, ClientIp) -> try - Stanza = xml_stream:parse_element(Data), + Stanza = {xmlel, _, _, _} = xml_stream:parse_element(Data), From = jlib:string_to_jid(xml:get_tag_attr_s(<<"from">>, Stanza)), To = jlib:string_to_jid(xml:get_tag_attr_s(<<"to">>, Stanza)), allowed = check_stanza(Stanza, From, To, Host),