From d6657ce1d4fa016bfa0e013f29351229e2cc23d1 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Mon, 6 Sep 2010 00:30:40 +0100 Subject: Fix NULL pointer dereference when removing nicks from groupchats. --- irc_im.c | 2 +- protocols/bee_chat.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/irc_im.c b/irc_im.c index 7fa70350..6c8b7f70 100644 --- a/irc_im.c +++ b/irc_im.c @@ -529,7 +529,7 @@ static gboolean bee_irc_chat_remove_user( bee_t *bee, struct groupchat *c, bee_u irc_t *irc = bee->ui_data; irc_channel_t *ic = c->ui_data; - if( ic == NULL ) + if( ic == NULL || bu == NULL ) return FALSE; /* TODO: Possible bug here: If a module removes $user here instead of just diff --git a/protocols/bee_chat.c b/protocols/bee_chat.c index 0314cae5..349e0547 100644 --- a/protocols/bee_chat.c +++ b/protocols/bee_chat.c @@ -195,7 +195,7 @@ void imcb_chat_remove_buddy( struct groupchat *c, const char *handle, const char bu = bee_user_by_handle( bee, ic, handle ); } - if( bee->ui->chat_remove_user ) + if( bee->ui->chat_remove_user && bu ) bee->ui->chat_remove_user( bee, c, bu ); } -- cgit v1.2.3