Mercurial > dovecot > original-hg > dovecot-1.2
changeset 6321:840bd34df909 HEAD
Don't allow empty keywords.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Mon, 27 Aug 2007 18:03:50 +0300 |
parents | 58b6fb965e62 |
children | 8d9a156ec94e |
files | src/lib-index/mail-index.c |
diffstat | 1 files changed, 5 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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); }