changeset 13016:5e5daccf1de3

fts: Added assert to make sure all header data is valid UTF-8.
author Timo Sirainen <tss@iki.fi>
date Wed, 11 May 2011 15:20:19 +0300
parents c392158f374d
children a6db801253c6
files src/plugins/fts/fts-storage.c
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/plugins/fts/fts-storage.c	Wed May 11 15:19:34 2011 +0300
+++ b/src/plugins/fts/fts-storage.c	Wed May 11 15:20:19 2011 +0300
@@ -4,6 +4,7 @@
 #include "ioloop.h"
 #include "array.h"
 #include "str.h"
+#include "unichar.h"
 #include "istream.h"
 #include "time-util.h"
 #include "rfc822-parser.h"
@@ -79,6 +80,8 @@
 	if (str_len(ctx->headers) == 0)
 		return 0;
 
+	i_assert(uni_utf8_data_is_valid(ctx->headers->data, ctx->headers->used));
+
 	fts_backend_build_hdr(ctx->build, ctx->uid);
 	if (fts_backend_build_more(ctx->build, str_data(ctx->headers),
 				   str_len(ctx->headers)) < 0)