Mercurial > pidgin
changeset 16059:e1cd60075d08
Avoid a possible NULL pointer dereference
author | Stu Tomlinson <stu@nosnilmot.com> |
---|---|
date | Wed, 11 Apr 2007 13:34:17 +0000 |
parents | 9e1b2223a5b1 |
children | 9fb7f9413174 |
files | libpurple/protocols/oscar/oscar.c |
diffstat | 1 files changed, 7 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/libpurple/protocols/oscar/oscar.c Wed Apr 11 13:32:57 2007 +0000 +++ b/libpurple/protocols/oscar/oscar.c Wed Apr 11 13:34:17 2007 +0000 @@ -1785,11 +1785,13 @@ else { PurpleBuddy *b = purple_find_buddy(account, info->sn); - PurpleStatus *status; - const char *active_status_id; - - status = purple_presence_get_active_status(purple_buddy_get_presence(b)); - active_status_id = purple_status_get_id(status); + PurpleStatus *status = NULL; + const char *active_status_id = NULL; + + if (b != NULL) { + status = purple_presence_get_active_status(purple_buddy_get_presence(b)); + active_status_id = purple_status_get_id(status); + } if (!active_status_id || strcmp(active_status_id, status_id)) purple_prpl_got_user_status(account, info->sn, status_id, NULL);