comparison libpurple/protocols/msn/contact.c @ 20855:cfaf74ec93dc

Prevent null pointer deref to fix CID 322.
author Daniel Atallah <daniel.atallah@gmail.com>
date Tue, 09 Oct 2007 23:33:49 +0000
parents 6736c1168c50
children bbcc9e206c43 c8f99cb61dc9 dead11aac1bc
comparison
equal deleted inserted replaced
20854:686a492e2b70 20855:cfaf74ec93dc
1175 user = msn_userlist_find_user(userlist, passport); 1175 user = msn_userlist_find_user(userlist, passport);
1176 if (user == NULL) { 1176 if (user == NULL) {
1177 purple_debug_warning("MSN CL", "Unable to retrieve user %s from the userlist!\n", passport); 1177 purple_debug_warning("MSN CL", "Unable to retrieve user %s from the userlist!\n", passport);
1178 } 1178 }
1179 1179
1180 if (user->uid != NULL) { 1180 if (user != NULL && user->uid != NULL) {
1181 contact_xml = g_strdup_printf(MSN_CONTACT_ID_XML, user->uid); 1181 contact_xml = g_strdup_printf(MSN_CONTACT_ID_XML, user->uid);
1182 } else { 1182 } else {
1183 contact_xml = g_strdup_printf(MSN_CONTACT_XML, passport); 1183 contact_xml = g_strdup_printf(MSN_CONTACT_XML, passport);
1184 } 1184 }
1185 1185