dovecot: Log an error if empty keyword name is tried to be used.

dovecot at dovecot.org dovecot at dovecot.org
Mon Aug 27 18:28:57 EEST 2007


details:   http://hg.dovecot.org/dovecot/rev/4a6dd4e894b4
changeset: 6323:4a6dd4e894b4
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Aug 27 18:28:30 2007 +0300
description:
Log an error if empty keyword name is tried to be used.

diffstat:

1 file changed, 5 insertions(+)
src/lib-index/mail-index-sync-keywords.c |    5 +++++

diffs (15 lines):

diff -r 8d9a156ec94e -r 4a6dd4e894b4 src/lib-index/mail-index-sync-keywords.c
--- a/src/lib-index/mail-index-sync-keywords.c	Mon Aug 27 18:28:06 2007 +0300
+++ b/src/lib-index/mail-index-sync-keywords.c	Mon Aug 27 18:28:30 2007 +0300
@@ -264,6 +264,11 @@ int mail_index_sync_keywords(struct mail
 	end = CONST_PTR_OFFSET(rec, hdr->size);
 
 	keyword_name = t_strndup(rec + 1, rec->name_size);
+	if (*keyword_name == '\0') {
+		mail_index_sync_set_corrupted(ctx,
+					      "Trying to use empty keyword");
+		return -1;
+	}
 	if (keyword_lookup(ctx, keyword_name, &keyword_idx) < 0)
 		return -1;
 	if (keyword_idx == (unsigned int)-1) {


More information about the dovecot-cvs mailing list