25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-24 16:23:40 +01:00

Nameprep host name passed to http-bind before using in (EJAB-1658)

This commit is contained in:
Paweł Chmielowski 2015-09-22 15:33:31 +02:00
parent 23a1aceac0
commit e289344972

View File

@ -220,8 +220,9 @@ process_request(Data, IP, HOpts) ->
"dressing' xmlns='", "dressing' xmlns='",
(?NS_HTTP_BIND)/binary, "'/>">>}; (?NS_HTTP_BIND)/binary, "'/>">>};
XmppDomain -> XmppDomain ->
NXmppDomain = jlib:nameprep(XmppDomain),
Sid = p1_sha:sha(term_to_binary({now(), make_ref()})), Sid = p1_sha:sha(term_to_binary({now(), make_ref()})),
case start(XmppDomain, Sid, <<"">>, IP, HOpts) of case start(NXmppDomain, Sid, <<"">>, IP, HOpts) of
{error, _} -> {error, _} ->
{500, ?HEADER, {500, ?HEADER,
<<"<body type='terminate' condition='internal-se" <<"<body type='terminate' condition='internal-se"
@ -229,7 +230,7 @@ process_request(Data, IP, HOpts) ->
(?NS_HTTP_BIND)/binary, (?NS_HTTP_BIND)/binary,
"'>Internal Server Error</body>">>}; "'>Internal Server Error</body>">>};
{ok, Pid} -> {ok, Pid} ->
handle_session_start(Pid, XmppDomain, Sid, Rid, Attrs, handle_session_start(Pid, NXmppDomain, Sid, Rid, Attrs,
Payload, PayloadSize, IP) Payload, PayloadSize, IP)
end end
end; end;