Avoid reading a byte just before our allocated buffer.
[notmuch] / notmuch-index-message.cc
index 3175d2d829b26b9c8db72d9d962bdf141cdb9851..dd3fbb44687ba1859be696bf86ae9ee12a86b8dd 100644 (file)
@@ -486,6 +486,10 @@ gen_terms_body_str (Xapian::TermGenerator term_gen,
        while (*next_line == '\n')
            next_line++;
 
+       /* Skip blank lines. */
+       if (line_end < line)
+           continue;
+
        /* Skip lines that are quotes. */
        if (*line == '>')
            continue;