changeset 3149:d0981562a9a3 HEAD

Don't crash with empty keyword lists.
author Timo Sirainen <tss@iki.fi>
date Wed, 09 Feb 2005 00:58:42 +0200
parents d9327a3dbf97
children cf00d5631c2a
files src/lib-index/mail-index-transaction.c
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-index/mail-index-transaction.c	Wed Feb 09 00:50:26 2005 +0200
+++ b/src/lib-index/mail-index-transaction.c	Wed Feb 09 00:58:42 2005 +0200
@@ -877,8 +877,11 @@
 	unsigned int count, i, j, k_pos = 0, missing_count = 0;
 	size_t size;
 
-	if (keywords == NULL)
-		return i_new(struct mail_keywords, 1);
+	if (keywords == NULL) {
+		k = i_new(struct mail_keywords, 1);
+		k->index = index;
+		return k;
+	}
 	count = strarray_length(keywords);
 
 	k = i_malloc(sizeof(struct mail_keywords) +