diff options
author | Michael Vetter <jubalh@iodoru.org> | 2018-07-30 12:23:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-30 12:23:53 +0200 |
commit | 811b3ba857f955fe825cba1622779f5e21048fcc (patch) | |
tree | cbc7b9729ad86d99f7fe5a8a7c3b64a1c5d61c26 /src/event | |
parent | 86a9ef7b5c89ab7830903b2c19a08e8174ecd0ca (diff) | |
parent | db18ba8bdf7d0c6d60357b8ab21129c332316a17 (diff) | |
download | profani-tty-811b3ba857f955fe825cba1622779f5e21048fcc.tar.gz |
Merge pull request #926 from msantos/null-pointer-dereference
server_events: fix potential NULL pointer deref
Diffstat (limited to 'src/event')
-rw-r--r-- | src/event/server_events.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/event/server_events.c b/src/event/server_events.c index b735c22f..5117d1f8 100644 --- a/src/event/server_events.c +++ b/src/event/server_events.c @@ -896,8 +896,8 @@ sv_ev_muc_occupant_online(const char *const room, const char *const nick, const ProfMucWin *mucwin = wins_get_muc(room); if (mucwin) { mucwin_occupant_nick_change(mucwin, old_nick, nick); + wins_private_nick_change(mucwin->roomjid, old_nick, nick); } - wins_private_nick_change(mucwin->roomjid, old_nick, nick); free(old_nick); occupantswin_occupants(room); @@ -914,11 +914,13 @@ sv_ev_muc_occupant_online(const char *const room, const char *const nick, const } prefs_free_string(muc_status_pref); - Jid *jidp = jid_create_from_bare_and_resource(mucwin->roomjid, nick); - ProfPrivateWin *privwin = wins_get_private(jidp->fulljid); - jid_destroy(jidp); - if (privwin) { - privwin_occupant_online(privwin); + if (mucwin) { + Jid *jidp = jid_create_from_bare_and_resource(mucwin->roomjid, nick); + ProfPrivateWin *privwin = wins_get_private(jidp->fulljid); + jid_destroy(jidp); + if (privwin) { + privwin_occupant_online(privwin); + } } occupantswin_occupants(room); |