msn: Fix NUL-pointer deref issue parsing mail notifications release-2.x.y
authorDaniel Atallah <datallah@pidgin.im>
Sat, 16 Mar 2013 14:17:45 -0400
branchrelease-2.x.y
changesetef836278304b pushlog
parent 23cbfff68a0c
child 68d6df7dc69c
msn: Fix NUL-pointer deref issue parsing mail notifications

* Thanks to Fabian Yamaguchi and Christian Wressnegger of the University of Goettingen
libpurple/protocols/msn/oim.c
      1.1 --- a/libpurple/protocols/msn/oim.c
      1.2 +++ b/libpurple/protocols/msn/oim.c
      1.3 @@ -824,10 +824,10 @@
      1.4  		char *unread = xmlnode_get_data(iu_node);
      1.5  		const char *passports[2] = { msn_user_get_passport(session->user) };
      1.6  		const char *urls[2] = { session->passport_info.mail_url };
      1.7 -		int count = atoi(unread);
      1.8 +		int count;
      1.9  
     1.10  		/* XXX/khc: pretty sure this is wrong */
     1.11 -		if (count > 0)
     1.12 +		if (unread && (count = atoi(unread)) > 0)
     1.13  			purple_notify_emails(session->account->gc, count, FALSE, NULL,
     1.14  				NULL, passports, urls, NULL, NULL);
     1.15  		g_free(unread);