]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] When fold on chars skip other folding logic
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 3 Apr 2018 16:49:52 +0000 (17:49 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 3 Apr 2018 16:57:59 +0000 (17:57 +0100)
Issue: #2111

src/libutil/str_util.c

index d571efabb0d07a9e2ba9b2e91600df0bd406014c..3b1f3c1e307a292a1e413f4aba025af5fa1c6b4a 100644 (file)
@@ -958,10 +958,12 @@ rspamd_header_value_fold (const gchar *name,
                switch (state) {
 
                case read_token:
-                       if (fold_on_chars && strchr (fold_on_chars, *p) != NULL) {
-                               fold_type = fold_after;
-                               state = fold_token;
-                               next_state = read_token;
+                       if (fold_on_chars) {
+                               if (strchr (fold_on_chars, *p) != NULL) {
+                                       fold_type = fold_after;
+                                       state = fold_token;
+                                       next_state = read_token;
+                               }
 
                                p ++;
                        }
@@ -1153,7 +1155,7 @@ rspamd_header_value_fold (const gchar *name,
        /* Last token */
        switch (state) {
        case read_token:
-               if (cur_len > fold_max && !first_token) {
+               if (!fold_on_chars && cur_len > fold_max && !first_token) {
                        if (g_ascii_isspace (*c)) {
                                c ++;
                        }