Don't crash on malformed IQ

Fixes #2175
This commit is contained in:
Evgeniy Khramtsov 2017-12-19 09:15:35 +03:00
parent c658f871a5
commit c9333f247a
1 changed files with 2 additions and 1 deletions

View File

@ -331,7 +331,8 @@ normal_state({route, <<"">>,
catch _:{xmpp_codec, Why} ->
ErrTxt = xmpp:io_format_error(Why),
Err = xmpp:err_bad_request(ErrTxt, Lang),
ejabberd_router:route_error(IQ0, Err)
ejabberd_router:route_error(IQ0, Err),
{next_state, normal_state, StateData}
end;
normal_state({route, <<"">>, #iq{} = IQ}, StateData) ->
Err = xmpp:err_bad_request(),