pidgin/pidgin

msn: Fix NUL-pointer deref issue parsing mail notifications
release-2.x.y
2013-03-16, Daniel Atallah
ef836278304b
Parents 23cbfff68a0c
Children 68d6df7dc69c
msn: Fix NUL-pointer deref issue parsing mail notifications

* Thanks to Fabian Yamaguchi and Christian Wressnegger of the University of Goettingen
--- a/libpurple/protocols/msn/oim.c Sat Mar 16 14:17:45 2013 -0400
+++ b/libpurple/protocols/msn/oim.c Sat Mar 16 14:17:45 2013 -0400
@@ -824,10 +824,10 @@
char *unread = xmlnode_get_data(iu_node);
const char *passports[2] = { msn_user_get_passport(session->user) };
const char *urls[2] = { session->passport_info.mail_url };
- int count = atoi(unread);
+ int count;
/* XXX/khc: pretty sure this is wrong */
- if (count > 0)
+ if (unread && (count = atoi(unread)) > 0)
purple_notify_emails(session->account->gc, count, FALSE, NULL,
NULL, passports, urls, NULL, NULL);
g_free(unread);