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),
|
||||
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};
|
||||
|
|
Loading…
Reference in New Issue