1
1
mirror of https://github.com/profanity-im/profanity.git synced 2025-01-03 14:57:42 -05:00

Merge pull request #926 from msantos/null-pointer-dereference

server_events: fix potential NULL pointer deref
This commit is contained in:
Michael Vetter 2018-07-30 12:23:53 +02:00 committed by GitHub
commit 811b3ba857
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);