evolution-data-server r9836 - branches/gnome-2-24/libedataserverui



Author: mcrha
Date: Mon Dec 15 12:10:38 2008
New Revision: 9836
URL: http://svn.gnome.org/viewvc/evolution-data-server?rev=9836&view=rev

Log:
2008-12-15  Milan Crha  <mcrha redhat com>

	** Fix for bug #555230

	* e-contact-store.c: (find_contact_by_view_and_uid):
	Do not crash when passed invalid arguments in.



Modified:
   branches/gnome-2-24/libedataserverui/ChangeLog
   branches/gnome-2-24/libedataserverui/e-contact-store.c

Modified: branches/gnome-2-24/libedataserverui/e-contact-store.c
==============================================================================
--- branches/gnome-2-24/libedataserverui/e-contact-store.c	(original)
+++ branches/gnome-2-24/libedataserverui/e-contact-store.c	Mon Dec 15 12:10:38 2008
@@ -372,6 +372,8 @@
 	GPtrArray     *contacts;
 	gint           i;
 
+	g_return_val_if_fail (find_uid != NULL, -1);
+
 	source_index = find_contact_source_by_view (contact_store, find_view);
 	if (source_index < 0)
 		return -1;
@@ -387,7 +389,7 @@
 		EContact    *contact = g_ptr_array_index (contacts, i);
 		const gchar *uid     = e_contact_get_const (contact, E_CONTACT_UID);
 
-		if (!strcmp (find_uid, uid))
+		if (uid && !strcmp (find_uid, uid))
 			return i;
 	}
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]