# HG changeset patch # User Timo Sirainen # Date 1188227030 -10800 # Node ID 840bd34df9097542dbcf7724ed2f9b4780687442 # Parent 58b6fb965e62956343ac93196455ec1061119158 Don't allow empty keywords. diff -r 58b6fb965e62 -r 840bd34df909 src/lib-index/mail-index.c --- a/src/lib-index/mail-index.c Mon Aug 27 17:55:05 2007 +0300 +++ b/src/lib-index/mail-index.c Mon Aug 27 18:03:50 2007 +0300 @@ -309,6 +309,11 @@ const char *keyword = name + kw_rec[i].name_offset; unsigned int idx; + if (*keyword == '\0') { + mail_index_set_error(index, "Corrupted index file %s: " + "Found empty keyword", index->filepath); + return -1; + } (void)mail_index_keyword_lookup(index, keyword, TRUE, &idx); array_append(&map->keyword_idx_map, &idx, 1); }