mirror of
https://github.com/processone/ejabberd.git
synced 2024-06-02 21:17:12 +02:00
XEP-0198: Reject <resume/> with negative 'h' value
Make sure the 'h' attribute sent with a <resume/> request is nonnegative, as mandated by XEP-0198. We already have this check for <a/> elements.
This commit is contained in:
parent
a60fda7df4
commit
15369ff9d7
|
@ -2707,7 +2707,7 @@ handle_resume(StateData, Attrs) ->
|
||||||
case {xml:get_attr(<<"previd">>, Attrs),
|
case {xml:get_attr(<<"previd">>, Attrs),
|
||||||
catch jlib:binary_to_integer(xml:get_attr_s(<<"h">>, Attrs))}
|
catch jlib:binary_to_integer(xml:get_attr_s(<<"h">>, Attrs))}
|
||||||
of
|
of
|
||||||
{{value, PrevID}, H} when is_integer(H) ->
|
{{value, PrevID}, H} when is_integer(H), H >= 0 ->
|
||||||
case inherit_session_state(StateData, PrevID) of
|
case inherit_session_state(StateData, PrevID) of
|
||||||
{ok, InheritedState} ->
|
{ok, InheritedState} ->
|
||||||
{ok, InheritedState, H};
|
{ok, InheritedState, H};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user