From bc03ae066bee95dc986578f6891be3de39671c4e Mon Sep 17 00:00:00 2001 From: Not Zed Date: Fri, 7 Mar 2003 03:38:45 +0000 Subject: handle a null return from search_by_expression, for bug #33786. 2003-03-07 Not Zed * camel-vee-folder.c (vee_search_by_expression): handle a null return from search_by_expression, for bug #33786. svn path=/trunk/; revision=20215 --- camel/ChangeLog | 5 +++++ camel/camel-vee-folder.c | 21 ++++++++++++--------- 2 files changed, 17 insertions(+), 9 deletions(-) (limited to 'camel') diff --git a/camel/ChangeLog b/camel/ChangeLog index d37731e83a..6af3c77a90 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,8 @@ +2003-03-07 Not Zed + + * camel-vee-folder.c (vee_search_by_expression): handle a null + return from search_by_expression, for bug #33786. + 2003-03-06 Jeffrey Stedfast * providers/imap/camel-imap-utils.c (imap_next_word): diff --git a/camel/camel-vee-folder.c b/camel/camel-vee-folder.c index 82f9c7feb0..9422f77e19 100644 --- a/camel/camel-vee-folder.c +++ b/camel/camel-vee-folder.c @@ -686,16 +686,19 @@ vee_search_by_expression(CamelFolder *folder, const char *expression, CamelExcep /* make sure we only search each folder once - for unmatched folder to work right */ if (g_hash_table_lookup(searched, f) == NULL) { camel_vee_folder_hash_folder(f, hash); - matches = camel_folder_search_by_expression(f, expression, ex); - for (i = 0; i < matches->len; i++) { - char *uid = matches->pdata[i], *vuid; - - vuid = g_malloc(strlen(uid)+9); - memcpy(vuid, hash, 8); - strcpy(vuid+8, uid); - g_ptr_array_add(result, vuid); + /* FIXME: shouldn't ignore search exception */ + matches = camel_folder_search_by_expression(f, expression, NULL); + if (matches) { + for (i = 0; i < matches->len; i++) { + char *uid = matches->pdata[i], *vuid; + + vuid = g_malloc(strlen(uid)+9); + memcpy(vuid, hash, 8); + strcpy(vuid+8, uid); + g_ptr_array_add(result, vuid); + } + camel_folder_search_free(f, matches); } - camel_folder_search_free(f, matches); g_hash_table_insert(searched, f, f); } node = g_list_next(node); -- cgit