]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
fts: Assert-crashfix to HTML parsing.
authorTimo Sirainen <tss@iki.fi>
Wed, 10 Aug 2011 12:03:59 +0000 (15:03 +0300)
committerTimo Sirainen <tss@iki.fi>
Wed, 10 Aug 2011 12:03:59 +0000 (15:03 +0300)
src/plugins/fts/fts-parser-html.c

index 0e268d83b0ecb9ce8d0dc9b8f44311ad1374c3f0..470c15b1ef13bc6e0a90b8f98a069c39c2933d44 100644 (file)
@@ -223,13 +223,15 @@ static void fts_parser_html_more(struct fts_parser *_parser,
                buffer_append(parser->input, block->data, size);
                size = parse_data(parser, parser->input->data,
                                  parser->input->used);
-               if (size == 0) {
-                       /* we're at EOF and can't finish this */
-                       i_assert(block->size == 0);
-               } else {
+               if (size != 0) {
                        i_assert(size >= buf_orig_size);
                        block->data += size - buf_orig_size;
                        block->size -= size - buf_orig_size;
+               } else if (block->size != 0) {
+                       /* we're slowly parsing forward */
+                       return;
+               } else {
+                       /* we're at EOF and can't finish this */
                }
                buffer_set_used_size(parser->input, 0);
        }