From bf2e401ad6246569faff56ec69429451faf7bcbd Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Mon, 27 Mar 2017 15:15:34 +0100 Subject: [PATCH] [Feature] Work with broken rfc2047 tokens --- src/ragel/rfc2047_parser.rl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ragel/rfc2047_parser.rl b/src/ragel/rfc2047_parser.rl index 05b08a6ae..26c016361 100644 --- a/src/ragel/rfc2047_parser.rl +++ b/src/ragel/rfc2047_parser.rl @@ -43,12 +43,12 @@ token = (graph - especials)+; charset = token; encoding = "Q" | "q" | "B" | "b"; - encoded_text = (print - ("?" | " "))+; + encoded_text = (print - ("?"))+; encoded_word = "=?" charset >Start_Charset %End_Charset ("*" language)? "?" encoding %End_Encoding "?" encoded_text >Start_Encoded %End_Encoded - "?="; + "?="?; main := encoded_word; }%% @@ -64,7 +64,8 @@ rspamd_rfc2047_parser (const gchar *in, gsize len, gint *pencoding, { const char *p = in, *pe = in + len, *encoded_start = NULL, *encoded_end = NULL, - *charset_start = NULL, *charset_end = NULL; + *charset_start = NULL, *charset_end = NULL, + *eof = in + len; gint encoding = RSPAMD_RFC2047_QP, cs = 0; %% write init; -- 2.39.5