25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-22 16:20:52 +01:00

Don't crash in mod_shared_roster_ldap:get_member_jid on empty output

This based on crash from issue #3614
This commit is contained in:
Paweł Chmielowski 2023-05-22 12:48:29 +02:00
parent dd2efc360b
commit 1818a29c29

View File

@ -395,14 +395,14 @@ get_member_jid(#state{user_jid_attr = UserJIDAttr, user_uid = UIDAttr} = State,
[{<<"%u">>, UID}])],
[UserJIDAttr]),
case Entries of
[] ->
{error, error};
[#eldap_entry{attributes = [{UserJIDAttr, [MemberJID | _]}]} | _] ->
try jid:decode(MemberJID) of
#jid{luser = U, lserver = S} -> {U, S}
catch
error:{bad_jid, _} -> {error, Host}
end
end;
_ ->
{error, error}
end.
extract_members(State, Extractor, AuthChecker, #eldap_entry{attributes = Attrs}, {DescAcc, JIDsAcc}) ->