]> dgit.raspbian.org Git - dovecot.git/commitdiff
[PATCH 1/2] lib-managesieve: managesieve-parser - Fix handling of lone CR character
authorStephan Bosch <stephan.bosch@open-xchange.com>
Sat, 11 Apr 2026 12:12:08 +0000 (14:12 +0200)
committerNoah Meyerhans <noahm@debian.org>
Wed, 16 Sep 2026 19:06:35 +0000 (15:06 -0400)
Gbp-Pq: Name 0001-lib-managesieve-managesieve-parser-Fix-handling-of-l.patch

pigeonhole/src/lib-managesieve/managesieve-parser.c

index 546e43181fc032ab124609caa35b8140f803f52e..3d34c1c3dc956890c171818c1797d4f0b7c57ea3 100644 (file)
@@ -441,6 +441,15 @@ static bool managesieve_parser_read_arg(struct managesieve_parser *parser)
 
                switch (data[0]) {
                case '\r':
+                       if (data_size == 1) {
+                               /* Wait for LF */
+                               return FALSE;
+                       }
+                       if (data[1] != '\n') {
+                               parser->error = "CR sent without LF";
+                               return FALSE;
+                       }
+                       /* Fall through */
                case '\n':
                        /* Unexpected end of line */
                        parser->eol = TRUE;