From 1cae0f1a15d107fd0f514b8a64ecfdf4af4768be Mon Sep 17 00:00:00 2001 From: Jon Trowbridge Date: Thu, 30 Aug 2001 03:39:57 +0000 Subject: Make sure that comp->priv->query_text isn't NULL. (Fixes bug #8195) 2001-08-29 Jon Trowbridge * gui/component/select-names/e-select-names-completion.c (book_query_score): Make sure that comp->priv->query_text isn't NULL. (Fixes bug #8195) svn path=/trunk/; revision=12524 --- addressbook/ChangeLog | 4 ++++ .../gui/component/select-names/e-select-names-completion.c | 11 ++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index 68432f6abd..656f02b22b 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,5 +1,9 @@ 2001-08-29 Jon Trowbridge + * gui/component/select-names/e-select-names-completion.c + (book_query_score): Make sure that comp->priv->query_text isn't + NULL. (Fixes bug #8195) + * backend/ebook/e-book-listener.c (e_book_listener_check_queue): This function can be re-entrant during the signal emission; Added extra ref/unrefs and checks to avoid problems if this happens. diff --git a/addressbook/gui/component/select-names/e-select-names-completion.c b/addressbook/gui/component/select-names/e-select-names-completion.c index 9e955338b3..b853dbe835 100644 --- a/addressbook/gui/component/select-names/e-select-names-completion.c +++ b/addressbook/gui/component/select-names/e-select-names-completion.c @@ -135,10 +135,12 @@ static ECompletionMatch * match_nickname (ESelectNamesCompletion *comp, EDestination *dest) { ECompletionMatch *match = NULL; - gint len = strlen (comp->priv->query_text); + gint len; ECard *card = e_destination_get_card (dest); double score; + len = strlen (comp->priv->query_text); + if (card->nickname && !g_utf8_strncasecmp (comp->priv->query_text, card->nickname, len)) { ECompletionMatch *match = g_new0 (ECompletionMatch, 1); @@ -555,9 +557,12 @@ book_query_score (ESelectNamesCompletion *comp, EDestination *dest) ECompletionMatch *best_match = NULL; gint i; - g_return_val_if_fail (comp && E_IS_SELECT_NAMES_COMPLETION (comp), NULL); - g_return_val_if_fail (dest && E_IS_DESTINATION (dest), NULL); + g_return_val_if_fail (E_IS_SELECT_NAMES_COMPLETION (comp), NULL); + g_return_val_if_fail (E_IS_DESTINATION (dest), NULL); + if (! (comp->priv->query_text && *comp->priv->query_text)) + return NULL; + for (i=0; i