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:
Holger Weiss 2014-05-09 18:01:31 +02:00
parent a60fda7df4
commit 15369ff9d7
1 changed files with 1 additions and 1 deletions

View File

@ -2707,7 +2707,7 @@ handle_resume(StateData, Attrs) ->
case {xml:get_attr(<<"previd">>, Attrs),
catch jlib:binary_to_integer(xml:get_attr_s(<<"h">>, Attrs))}
of
{{value, PrevID}, H} when is_integer(H) ->
{{value, PrevID}, H} when is_integer(H), H >= 0 ->
case inherit_session_state(StateData, PrevID) of
{ok, InheritedState} ->
{ok, InheritedState, H};